From d874dde2827e96dbbb09f89f4d9e671c43725eef Mon Sep 17 00:00:00 2001 From: matz Date: Wed, 19 Dec 2007 17:46:17 +0000 Subject: * string.c (rb_str_each_line): should consider rslen. * string.c (rb_str_buf_append): should propagate encoding. * string.c (rb_str_each_line): ditto. * test/ruby/test_m17n.rb (TestM17N::test_str_each_line): should check encoding as well. * test/ruby/test_m17n.rb (TestM17N::test_str_each_line): empty array can not propagate encoding; should not check. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14343 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_m17n.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'test/ruby/test_m17n.rb') diff --git a/test/ruby/test_m17n.rb b/test/ruby/test_m17n.rb index d723470dd2..a0f3428c3d 100644 --- a/test/ruby/test_m17n.rb +++ b/test/ruby/test_m17n.rb @@ -1201,7 +1201,10 @@ class TestM17N < Test::Unit::TestCase assert_equal(s1.encoding, line.encoding) lines << line } - assert_equal(s1, lines.join('')) + next if lines.size == 0 + s2 = lines.join('') + assert_equal(s1.encoding, s2.encoding) + assert_equal(s1, s2) } end -- cgit v1.2.3