diff options
author | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-09-09 12:22:43 +0000 |
---|---|---|
committer | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-09-09 12:22:43 +0000 |
commit | d456f7e357f8259bd4b73c1cdac74add216e4746 (patch) | |
tree | 505ccb392766873db78fbf542fa78a6718076951 /test/ruby | |
parent | a729be8433c2b1fb1057ca04d99b7408dd7d25a0 (diff) | |
download | ruby-d456f7e357f8259bd4b73c1cdac74add216e4746.tar.gz |
* include/ruby/encoding.h (ECONV_DECORATOR_MASK): merge
ECONV_ENCODER_MASK and ECONV_DECORATOR_MASK.
(ECONV_UNIVERSAL_NEWLINE_DECORATOR): renamed from
ECONV_UNIVERSAL_NEWLINE_DECODER.
(ECONV_CRLF_NEWLINE_DECORATOR): renamed from
ECONV_CRLF_NEWLINE_ENCODER.
(ECONV_CR_NEWLINE_DECORATOR): renamed from ECONV_CR_NEWLINE_ENCODER.
(ECONV_XML_TEXT_DECORATOR): renamed from ECONV_XML_TEXT_ENCODER.
(ECONV_XML_ATTR_CONTENT_DECORATOR): renamed from
ECONV_XML_ATTR_CONTENT_ENCODER.
(ECONV_STATEFUL_DECORATOR_MASK): renamed from
ECONV_STATEFUL_ENCODER_MASK.
(ECONV_XML_ATTR_QUOTE_DECORATOR): renamed from
ECONV_XML_ATTR_CONTENT_DECORATOR.
* io.c: follow the renaming.
* transcode.c: ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19271 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby')
-rw-r--r-- | test/ruby/test_econv.rb | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/test/ruby/test_econv.rb b/test/ruby/test_econv.rb index a82105a3f8..efef7dfff5 100644 --- a/test/ruby/test_econv.rb +++ b/test/ruby/test_econv.rb @@ -69,23 +69,23 @@ class TestEncodingConverter < Test::Unit::TestCase def test_newline_converter_with_ascii_incompatible assert_nothing_raised { - Encoding::Converter.new("UTF-8", "UTF-16BE", Encoding::Converter::UNIVERSAL_NEWLINE_DECODER) + Encoding::Converter.new("UTF-8", "UTF-16BE", Encoding::Converter::UNIVERSAL_NEWLINE_DECORATOR) } assert_nothing_raised { - Encoding::Converter.new("UTF-16BE", "UTF-8", Encoding::Converter::CRLF_NEWLINE_ENCODER) + Encoding::Converter.new("UTF-16BE", "UTF-8", Encoding::Converter::CRLF_NEWLINE_DECORATOR) } assert_nothing_raised { - Encoding::Converter.new("UTF-16BE", "UTF-8", Encoding::Converter::CR_NEWLINE_ENCODER) + Encoding::Converter.new("UTF-16BE", "UTF-8", Encoding::Converter::CR_NEWLINE_DECORATOR) } assert_nothing_raised { - Encoding::Converter.new("UTF-16BE", "UTF-8", Encoding::Converter::UNIVERSAL_NEWLINE_DECODER) + Encoding::Converter.new("UTF-16BE", "UTF-8", Encoding::Converter::UNIVERSAL_NEWLINE_DECORATOR) } assert_nothing_raised { - Encoding::Converter.new("UTF-8", "UTF-16BE", Encoding::Converter::CRLF_NEWLINE_ENCODER) + Encoding::Converter.new("UTF-8", "UTF-16BE", Encoding::Converter::CRLF_NEWLINE_DECORATOR) } assert_nothing_raised { - Encoding::Converter.new("UTF-8", "UTF-16BE", Encoding::Converter::CR_NEWLINE_ENCODER) + Encoding::Converter.new("UTF-8", "UTF-16BE", Encoding::Converter::CR_NEWLINE_DECORATOR) } end @@ -372,7 +372,7 @@ class TestEncodingConverter < Test::Unit::TestCase end def test_universal_newline - ec = Encoding::Converter.new("UTF-8", "EUC-JP", universal_newline_decoder: true) + ec = Encoding::Converter.new("UTF-8", "EUC-JP", universal_newline: true) a = ["", src="", ec, nil, 50, :partial_input=>true] src << "abc\r\ndef"; check_ec("abc\ndef", "", :source_buffer_empty, *a) src << "ghi\njkl"; check_ec("abc\ndefghi\njkl", "", :source_buffer_empty, *a) @@ -383,7 +383,7 @@ class TestEncodingConverter < Test::Unit::TestCase end def test_universal_newline2 - ec = Encoding::Converter.new("", "", universal_newline_decoder: true) + ec = Encoding::Converter.new("", "", universal_newline: true) a = ["", src="", ec, nil, 50, :partial_input=>true] src << "abc\r\ndef"; check_ec("abc\ndef", "", :source_buffer_empty, *a) src << "ghi\njkl"; check_ec("abc\ndefghi\njkl", "", :source_buffer_empty, *a) @@ -394,22 +394,22 @@ class TestEncodingConverter < Test::Unit::TestCase end def test_crlf_newline - ec = Encoding::Converter.new("UTF-8", "EUC-JP", crlf_newline_encoder: true) + ec = Encoding::Converter.new("UTF-8", "EUC-JP", crlf_newline: true) assert_econv("abc\r\ndef", :finished, 50, ec, "abc\ndef", "") end def test_crlf_newline2 - ec = Encoding::Converter.new("", "", crlf_newline_encoder: true) + ec = Encoding::Converter.new("", "", crlf_newline: true) assert_econv("abc\r\ndef", :finished, 50, ec, "abc\ndef", "") end def test_cr_newline - ec = Encoding::Converter.new("UTF-8", "EUC-JP", cr_newline_encoder: true) + ec = Encoding::Converter.new("UTF-8", "EUC-JP", cr_newline: true) assert_econv("abc\rdef", :finished, 50, ec, "abc\ndef", "") end def test_cr_newline2 - ec = Encoding::Converter.new("", "", cr_newline_encoder: true) + ec = Encoding::Converter.new("", "", cr_newline: true) assert_econv("abc\rdef", :finished, 50, ec, "abc\ndef", "") end @@ -777,18 +777,18 @@ class TestEncodingConverter < Test::Unit::TestCase end def test_xml_escape_with_charref - ec = Encoding::Converter.new("utf-8", "euc-jp", Encoding::Converter::XML_TEXT_ENCODER|Encoding::Converter::UNDEF_HEX_CHARREF) + ec = Encoding::Converter.new("utf-8", "euc-jp", Encoding::Converter::XML_TEXT_DECORATOR|Encoding::Converter::UNDEF_HEX_CHARREF) assert_equal('<♥>&"♡"', ec.convert("<\u2665>&\"\u2661\"")) assert_equal('', ec.finish) ec = Encoding::Converter.new("utf-8", "euc-jp", - Encoding::Converter::XML_ATTR_CONTENT_ENCODER| - Encoding::Converter::XML_ATTR_QUOTE_ENCODER| + Encoding::Converter::XML_ATTR_CONTENT_DECORATOR| + Encoding::Converter::XML_ATTR_QUOTE_DECORATOR| Encoding::Converter::UNDEF_HEX_CHARREF) assert_equal('"<♥>&"♡"', ec.convert("<\u2665>&\"\u2661\"")) assert_equal('"', ec.finish) - ec = Encoding::Converter.new("utf-8", "iso-2022-jp", Encoding::Converter::XML_TEXT_ENCODER) + ec = Encoding::Converter.new("utf-8", "iso-2022-jp", Encoding::Converter::XML_TEXT_DECORATOR) assert_equal("&\e$B$&\e(B&".force_encoding("iso-2022-jp"), ec.convert("&\u3046&")) assert_equal('', ec.finish) end |