From 32b1dc88426a0462354c4ae0e8e178f3b5d47cd6 Mon Sep 17 00:00:00 2001 From: akr Date: Mon, 24 Dec 2007 01:09:37 +0000 Subject: add a test. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@14563 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_io_m17n.rb | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'test/ruby') diff --git a/test/ruby/test_io_m17n.rb b/test/ruby/test_io_m17n.rb index 16dc9f232..4fdbc1a2a 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" -- cgit