summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authornagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-06-12 14:23:39 +0000
committernagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-06-12 14:23:39 +0000
commit63bc35ffb00b4231beeaae8f7c9b394c107cff92 (patch)
tree18490fc948eff7634d9a7f30726f578e2e5bb344 /test
parentfdae1084ba611f6ad489013df7242c829ebe62e3 (diff)
merge revision(s) 41250: [Backport #8516]
* io.c (io_getc): fix 7bit coderange condition, check if ascii read data instead of read length. [ruby-core:55444] [Bug #8516] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_0_0@41260 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_io_m17n.rb12
1 files changed, 11 insertions, 1 deletions
diff --git a/test/ruby/test_io_m17n.rb b/test/ruby/test_io_m17n.rb
index 465194b6ca..031b0f4928 100644
--- a/test/ruby/test_io_m17n.rb
+++ b/test/ruby/test_io_m17n.rb
@@ -2159,7 +2159,17 @@ EOT
open("a", "wb") {|f| f.puts "a"}
open("a", "rt") {|f| f.getc}
}
- assert(c.ascii_only?, "should be ascii_only #{bug4557}")
+ assert_predicate(c, :ascii_only?, bug4557)
+ end
+
+ def test_getc_conversion
+ bug8516 = '[ruby-core:55444] [Bug #8516]'
+ c = with_tmpdir {
+ open("a", "wb") {|f| f.putc "\xe1"}
+ open("a", "r:iso-8859-1:utf-8") {|f| f.getc}
+ }
+ assert_not_predicate(c, :ascii_only?, bug8516)
+ assert_equal(1, c.size, bug8516)
end
def test_default_mode_on_dosish