summaryrefslogtreecommitdiff
path: root/test/rexml/parser/test_sax2.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/rexml/parser/test_sax2.rb')
-rw-r--r--test/rexml/parser/test_sax2.rb31
1 files changed, 29 insertions, 2 deletions
diff --git a/test/rexml/parser/test_sax2.rb b/test/rexml/parser/test_sax2.rb
index d808899dd23..f1e64121af2 100644
--- a/test/rexml/parser/test_sax2.rb
+++ b/test/rexml/parser/test_sax2.rb
@@ -22,9 +22,9 @@ class TestSAX2Parser < Test::Unit::TestCase
@entity_declarations = []
end
- def entitydecl(*args)
+ def entitydecl(declaration)
super
- @entity_declarations << args
+ @entity_declarations << declaration
end
end
@@ -51,6 +51,33 @@ class TestSAX2Parser < Test::Unit::TestCase
INTERNAL_SUBSET
end
end
+
+ class TestExternlID < self
+ class TestSystem < self
+ def test_without_ndata
+ declaration = [
+ "name",
+ "SYSTEM", "system-literal",
+ ]
+ assert_equal([declaration],
+ parse(<<-INTERNAL_SUBSET))
+<!ENTITY name SYSTEM "system-literal">
+ INTERNAL_SUBSET
+ end
+ end
+
+ class TestPublic < self
+ def test_without_ndata
+ declaration = [
+ "name",
+ "PUBLIC", "public-literal", "system-literal",
+ ]
+ assert_equal([declaration], parse(<<-INTERNAL_SUBSET))
+<!ENTITY name PUBLIC "public-literal" "system-literal">
+ INTERNAL_SUBSET
+ end
+ end
+ end
end
end
end