From e2630984e947f89a7ce198c60256fffc3b64cabd Mon Sep 17 00:00:00 2001 From: akr Date: Mon, 24 Dec 2007 01:09:37 +0000 Subject: [PATCH] add a test. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14563 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_io_m17n.rb | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/test/ruby/test_io_m17n.rb b/test/ruby/test_io_m17n.rb index 16dc9f232e..4fdbc1a2ac 100644 --- a/test/ruby/test_io_m17n.rb +++ b/test/ruby/test_io_m17n.rb @@ -66,6 +66,17 @@ EOT } end + def test_nonascii_terminator + with_tmpdir { + generate_file('tmp', "before \xA2\xA2 after") + open("tmp", "r:euc-jp") {|f| + assert_raise(ArgumentError) { + f.gets("\xA2\xA2".force_encoding("utf-8")) + } + } + } + end + def test_pipe_terminator_conversion with_pipe("euc-jp:utf-8") {|r, w| w.write "before \xa2\xa2 after"