Skip to content

Commit

Permalink
Add a test case to unnormalize the predefined entities of "text" in t…
Browse files Browse the repository at this point in the history
…he stream parser.

See: ruby#168
  • Loading branch information
naitoh committed Aug 20, 2024
1 parent cb15858 commit 68939ea
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions test/test_stream.rb
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,21 @@ def entity(content)

assert_equal(["ISOLat2"], listener.entities)
end

def test_characters_predefined_entities
source = '<root><a>&lt;P&gt; &lt;I&gt; &lt;B&gt; Text &lt;/B&gt; &lt;/I&gt;</a></root>'

listener = MyListener.new
class << listener
attr_accessor :text_value
def text(text)
@text_value << text
end
end
listener.text_value = ""
REXML::Document.parse_stream(source, listener)
assert_equal("<P> <I> <B> Text </B> </I>", listener.text_value)
end
end

class EntityExpansionLimitTest < Test::Unit::TestCase
Expand Down

0 comments on commit 68939ea

Please sign in to comment.