diff options
author | kou <kou@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-04-26 14:36:30 +0000 |
---|---|---|
committer | kou <kou@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-04-26 14:36:30 +0000 |
commit | 4e44eeaeb103f9ad43acc991918a4ae3cd1049cf (patch) | |
tree | d3a6f08ef29bd0e84b8ca3f47ea762295f4fb076 /test | |
parent | 562648e48ca42e6a263d52677638683add7327a6 (diff) | |
download | ruby-4e44eeaeb103f9ad43acc991918a4ae3cd1049cf.tar.gz |
* lib/rexml/text.rb (REXML::Text.normalize): Fix a bug that all
entity filters are ignored. [ruby-dev:47278] [Bug #8302]
Patch by Ippei Obayashi. Thanks!!!
* test/rexml/test_entity.rb (EntityTester#test_entity_filter): Add
a test of the above change.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40484 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r-- | test/rexml/test_entity.rb | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/test/rexml/test_entity.rb b/test/rexml/test_entity.rb index 5900fac7a8..7b9f39495f 100644 --- a/test/rexml/test_entity.rb +++ b/test/rexml/test_entity.rb @@ -164,4 +164,24 @@ class EntityTester < Test::Unit::TestCase def test_single_pass_unnormalization # ticket 123 assert_equal '&&', REXML::Text::unnormalize('&amp;&') end + + def test_entity_filter + document = REXML::Document.new(<<-XML) +<!DOCTYPE root [ +<!ENTITY copy "(c)"> +<!ENTITY release-year "2013"> +]> +<root/> +XML + respect_whitespace = false + parent = document.root + raw = false + entity_filter = ["copy"] + assert_equal("(c) &release-year;", + REXML::Text.new("(c) 2013", + respect_whitespace, + parent, + raw, + entity_filter).to_s) + end end |