diff options
author | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-09-06 14:05:10 +0000 |
---|---|---|
committer | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-09-06 14:05:10 +0000 |
commit | 76b306302241a9fb6411571c4cbfe701fdd56f54 (patch) | |
tree | d0e84110a08867d79b379adaa1089dd9485a430c /test/ruby/test_econv.rb | |
parent | d98bc00582af97ad86e88efd88835d22b1f1f532 (diff) | |
download | ruby-76b306302241a9fb6411571c4cbfe701fdd56f54.tar.gz |
* include/ruby/encoding.h (ECONV_XML_TEXT_ENCODER): renamed from
ECONV_HTML_TEXT_ENCODER.
(ECONV_XML_ATTR_ENCODER): renamed from ECONV_HTML_ATTR_ENCODER.
* enc/trans/escape.trans: follow the renaming.
* transcode.c: ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19191 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_econv.rb')
-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 2fcc6ab786..5c9fc143b1 100644 --- a/test/ruby/test_econv.rb +++ b/test/ruby/test_econv.rb @@ -34,7 +34,7 @@ class TestEncodingConverter < Test::Unit::TestCase assert_nil(Encoding::Converter.stateless_encoding("UTF-8")) assert_nil(Encoding::Converter.stateless_encoding("UTF-16BE")) assert_nil(Encoding::Converter.stateless_encoding(Encoding::UTF_8)) - assert_nil(Encoding::Converter.stateless_encoding("html-attr-escaped")) + assert_nil(Encoding::Converter.stateless_encoding("xml-attr-escaped")) end def test_stateless_encoding_iso2022jp @@ -728,54 +728,54 @@ class TestEncodingConverter < Test::Unit::TestCase assert_equal("&", ec.convert("&")) end - def test_html_escape_text + def test_xml_escape_text ec = Encoding::Converter.new("", "amp-escaped") assert_equal('&<>"', ec.convert("&<>\"")) assert_equal('', ec.finish) - ec = Encoding::Converter.new("", "html-text-escaped") + ec = Encoding::Converter.new("", "xml-text-escaped") assert_equal('&<>"', ec.convert("&<>\"")) assert_equal('', ec.finish) end - def test_html_escape_attr - ec = Encoding::Converter.new("", "html-attr-escaped") + def test_xml_escape_attr + ec = Encoding::Converter.new("", "xml-attr-escaped") assert_equal('""', ec.finish) - ec = Encoding::Converter.new("", "html-attr-escaped") + ec = Encoding::Converter.new("", "xml-attr-escaped") assert_equal('', ec.convert("")) assert_equal('""', ec.finish) - ec = Encoding::Converter.new("", "html-attr-escaped") + ec = Encoding::Converter.new("", "xml-attr-escaped") assert_equal('""', ec.convert('"')) assert_equal('"', ec.finish) - ec = Encoding::Converter.new("", "html-attr-escaped") + ec = Encoding::Converter.new("", "xml-attr-escaped") assert_equal('"&<>"', ec.convert("&<>\"")) assert_equal('"', ec.finish) end - def test_html_escape_with_charref - ec = Encoding::Converter.new("utf-8", "euc-jp", Encoding::Converter::HTML_TEXT_ENCODER|Encoding::Converter::UNDEF_HEX_CHARREF) + def test_xml_escape_with_charref + ec = Encoding::Converter.new("utf-8", "euc-jp", Encoding::Converter::XML_TEXT_ENCODER|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::HTML_ATTR_ENCODER|Encoding::Converter::UNDEF_HEX_CHARREF) + ec = Encoding::Converter.new("utf-8", "euc-jp", Encoding::Converter::XML_ATTR_ENCODER|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::HTML_TEXT_ENCODER) + ec = Encoding::Converter.new("utf-8", "iso-2022-jp", Encoding::Converter::XML_TEXT_ENCODER) assert_equal("&\e$B$&\e(B&".force_encoding("iso-2022-jp"), ec.convert("&\u3046&")) assert_equal('', ec.finish) end - def test_html_hasharg + def test_xml_hasharg assert_equal("&\e$B$&\e(B♥&\"'".force_encoding("iso-2022-jp"), - "&\u3046\u2665&\"'".encode("iso-2022-jp", html: :text)) + "&\u3046\u2665&\"'".encode("iso-2022-jp", xml: :text)) assert_equal("\"&\e$B$&\e(B♡&"'\"".force_encoding("iso-2022-jp"), - "&\u3046\u2661&\"'".encode("iso-2022-jp", html: :attr)) + "&\u3046\u2661&\"'".encode("iso-2022-jp", xml: :attr)) assert_equal("&\u3046\u2661&\"'".force_encoding("utf-8"), - "&\u3046\u2661&\"'".encode("utf-8", html: :text)) + "&\u3046\u2661&\"'".encode("utf-8", xml: :text)) end end |