mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
move the test for [ruby-core:14288].
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14525 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
cf36df97fb
commit
c534670da1
2 changed files with 22 additions and 8 deletions
|
@ -3,14 +3,6 @@
|
|||
# So all tests will cause failure.
|
||||
#
|
||||
|
||||
assert_equal 'ok', %q{
|
||||
open("tmp", "w") {|f| f.write "a\u00FFb" }
|
||||
s = open("tmp", "r:iso-8859-1:utf-8") {|f|
|
||||
f.gets("\xFF".force_encoding("iso-8859-1"))
|
||||
}
|
||||
s == "a\xFF" ? :ok : :ng
|
||||
}, '[ruby-core:14288]'
|
||||
|
||||
assert_equal 'ok', %q{
|
||||
open("require-lock-test.rb", "w") {|f|
|
||||
f.puts "sleep 0.1"
|
||||
|
|
22
test/ruby/test_io_m17n.rb
Normal file
22
test/ruby/test_io_m17n.rb
Normal file
|
@ -0,0 +1,22 @@
|
|||
require 'test/unit'
|
||||
require 'tmpdir'
|
||||
|
||||
class TestIOM17N < Test::Unit::TestCase
|
||||
def with_tmpdir
|
||||
Dir.mktmpdir {|dir|
|
||||
Dir.chdir dir
|
||||
yield dir
|
||||
}
|
||||
end
|
||||
|
||||
def test_conversion
|
||||
with_tmpdir {
|
||||
open("tmp", "w") {|f| f.write "before \u00FF after" }
|
||||
s = open("tmp", "r:iso-8859-1:utf-8") {|f|
|
||||
f.gets("\xFF".force_encoding("iso-8859-1"))
|
||||
}
|
||||
assert_equal("before \xFF".force_encoding("iso-8859-1"), s, '[ruby-core:14288]')
|
||||
}
|
||||
end
|
||||
end
|
||||
|
Loading…
Reference in a new issue