1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* test/ruby/test_io_m17n.rb: Add test for coderange clearing in

IO#read with buffer. See jruby/jruby#2316.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48847 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
headius 2014-12-15 18:56:30 +00:00
parent 85b42fe17b
commit 0f99627a79

View file

@ -2547,4 +2547,20 @@ EOT
end
}
end if /mswin|mingw/ =~ RUBY_PLATFORM
def test_read_with_buf_broken_ascii_only
a, b = IO.pipe
a.binmode
b.binmode
b.write("\xE2\x9C\x93")
b.close
buf = "".force_encoding("binary")
assert buf.ascii_only?, "should have been ascii_only?"
a.read(1, buf)
assert !buf.ascii_only?, "should not have been ascii_only?"
ensure
a.close rescue nil
b.close rescue nil
end
end