summaryrefslogtreecommitdiff
path: root/test/rexml/parse/test_processing_instruction.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/rexml/parse/test_processing_instruction.rb')
-rw-r--r--test/rexml/parse/test_processing_instruction.rb19
1 files changed, 19 insertions, 0 deletions
diff --git a/test/rexml/parse/test_processing_instruction.rb b/test/rexml/parse/test_processing_instruction.rb
index a23513fc6e..f0c0c24e67 100644
--- a/test/rexml/parse/test_processing_instruction.rb
+++ b/test/rexml/parse/test_processing_instruction.rb
@@ -20,6 +20,25 @@ Last 80 unconsumed characters:
<??>
DETAIL
end
+
+ def test_garbage_text
+ # TODO: This should be parse error.
+ # Create test/parse/test_document.rb or something and move this to it.
+ doc = parse(<<-XML)
+x<?x y
+<!--?><?x -->?>
+<r/>
+ XML
+ pi = doc.children[1]
+ assert_equal([
+ "x",
+ "y\n<!--",
+ ],
+ [
+ pi.target,
+ pi.content,
+ ])
+ end
end
end
end