summaryrefslogtreecommitdiffstats
path: root/test/ruby
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-12-24 16:36:14 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-12-24 16:36:14 +0000
commit368a41151e2969097787eb663ba1bb5c1fb09efd (patch)
tree9092b223c6ff47b94e637088e56e6ab27f7c2229 /test/ruby
parent0912f7a6fc0fb13e9f5e2a215c3024269e4b7d44 (diff)
downloadruby-368a41151e2969097787eb663ba1bb5c1fb09efd.tar.gz
ruby-368a41151e2969097787eb663ba1bb5c1fb09efd.tar.xz
ruby-368a41151e2969097787eb663ba1bb5c1fb09efd.zip
* include/ruby/encoding.h (rb_enc_left_char_head): new utility macro.
* include/ruby/encoding.h (rb_enc_right_char_head): ditto. * io.c (appendline): does multibyte RS search in the function. * io.c (prepare_getline_args): RS may be nil. * io.c (rb_io_getc): should process character based on external encoding, when transcoding required. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@14619 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby')
-rw-r--r--test/ruby/test_io_m17n.rb9
1 files changed, 5 insertions, 4 deletions
diff --git a/test/ruby/test_io_m17n.rb b/test/ruby/test_io_m17n.rb
index 6bc9025f1..e90d1dd91 100644
--- a/test/ruby/test_io_m17n.rb
+++ b/test/ruby/test_io_m17n.rb
@@ -87,7 +87,7 @@ EOT
def test_open_w
with_tmpdir {
open("tmp", "w") {|f|
- assert_equal(nil, f.external_encoding)
+ assert_equal(Encoding.default_external, f.external_encoding)
assert_equal(nil, f.internal_encoding)
}
}
@@ -96,7 +96,7 @@ EOT
def test_open_wb
with_tmpdir {
open("tmp", "wb") {|f|
- assert_equal(nil, f.external_encoding)
+ assert_equal(Encoding::ASCII_8BIT, f.external_encoding)
assert_equal(nil, f.internal_encoding)
}
}
@@ -135,12 +135,12 @@ EOT
end
def test_stdout
- assert_equal(nil, STDOUT.external_encoding)
+ assert_equal(Encoding.default_external, STDOUT.external_encoding)
assert_equal(nil, STDOUT.internal_encoding)
end
def test_stderr
- assert_equal(nil, STDERR.external_encoding)
+ assert_equal(Encoding.default_external, STDERR.external_encoding)
assert_equal(nil, STDERR.internal_encoding)
end
@@ -181,6 +181,7 @@ EOT
with_pipe("euc-jp:utf-8") {|r, w|
w.write "before \xa2\xa2 after"
rs = "\xA2\xA2".encode("utf-8", "euc-jp")
+ w.close
timeout(1) {
assert_equal("before \xa2\xa2".encode("utf-8", "euc-jp"),
r.gets(rs))