diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-04-26 15:55:21 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-04-26 15:55:21 +0000 |
commit | 876146772787599c894369801034f1fed1d16b54 (patch) | |
tree | 91f02a41b3b508bfea3bffbe4e27985cac0a75d4 /test/ruby/test_econv.rb | |
parent | 3b937bbdc4abc6ec1d3ec5d6b4e31714e0456e35 (diff) | |
download | ruby-876146772787599c894369801034f1fed1d16b54.tar.gz |
* io.c (validate_enc_binmode, rb_io_extract_modeenc): set newline
decorator according to open mode.
* transcode.c (rb_econv_prepare_options): new function, to prepare
econv options with newline flags.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31355 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_econv.rb')
-rw-r--r-- | test/ruby/test_econv.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/test/ruby/test_econv.rb b/test/ruby/test_econv.rb index 00682f69cd..765616da3d 100644 --- a/test/ruby/test_econv.rb +++ b/test/ruby/test_econv.rb @@ -449,6 +449,16 @@ class TestEncodingConverter < Test::Unit::TestCase assert_econv("abc\rdef", :finished, 50, ec, "abc\ndef", "") end + def test_no_universal_newline1 + ec = Encoding::Converter.new("UTF-8", "EUC-JP", universal_newline: false) + assert_econv("abc\r\ndef", :finished, 50, ec, "abc\r\ndef", "") + end + + def test_no_universal_newline2 + ec = Encoding::Converter.new("", "", universal_newline: false) + assert_econv("abc\r\ndef", :finished, 50, ec, "abc\r\ndef", "") + end + def test_after_output ec = Encoding::Converter.new("UTF-8", "EUC-JP") a = ["", "abc\u{3042}def", ec, nil, 100, :after_output=>true] |