ruby-changes:3071
From: ko1@a...
Date: 24 Dec 2007 10:09:55 +0900
Subject: [ruby-changes:3071] akr - Ruby:r14563 (trunk): add a test.
akr 2007-12-24 10:09:37 +0900 (Mon, 24 Dec 2007)
New Revision: 14563
Modified files:
trunk/test/ruby/test_io_m17n.rb
Log:
add a test.
http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/test/ruby/test_io_m17n.rb?r1=14563&r2=14562
Index: test/ruby/test_io_m17n.rb
===================================================================
--- test/ruby/test_io_m17n.rb (revision 14562)
+++ test/ruby/test_io_m17n.rb (revision 14563)
@@ -66,6 +66,17 @@
}
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"
--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml