summaryrefslogtreecommitdiff
path: root/test
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
commita04a812ed0aa7424ea1f40756402d1f199a43308 (patch)
tree9092b223c6ff47b94e637088e56e6ab27f7c2229 /test
parent13e239a0120deefd6f2e60345796e282a78ace29 (diff)
* 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: svn+ssh://ci.ruby-lang.org/ruby/trunk@14619 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-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 6bc9025f1a..e90d1dd916 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))