mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
add tests.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19110 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
58964e3249
commit
8c321128d9
1 changed files with 15 additions and 0 deletions
|
@ -791,6 +791,21 @@ EOT
|
|||
}
|
||||
end
|
||||
|
||||
def test_set_encoding_undef_replace
|
||||
with_pipe {|r, w|
|
||||
w << "\ufffd"
|
||||
w.close
|
||||
r.set_encoding("utf-8", "euc-jp", :undef=>:replace, :replace=>"ZZZ")
|
||||
assert_equal("ZZZ", r.read)
|
||||
}
|
||||
with_pipe {|r, w|
|
||||
w << "\ufffd"
|
||||
w.close
|
||||
r.set_encoding("utf-8:euc-jp", :undef=>:replace, :replace=>"ZZZ")
|
||||
assert_equal("ZZZ", r.read)
|
||||
}
|
||||
end
|
||||
|
||||
def test_write_conversion_fixenc
|
||||
with_pipe {|r, w|
|
||||
w.set_encoding("iso-2022-jp:utf-8")
|
||||
|
|
Loading…
Reference in a new issue