summaryrefslogtreecommitdiff
path: root/test/rexml/parser
diff options
context:
space:
mode:
authorkou <kou@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-09-03 14:01:20 +0000
committerkou <kou@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-09-03 14:01:20 +0000
commit73c57761a91e9a9240aea829453cc545ed033fee (patch)
tree4ca60f8af78ea59d2009643ba3cabfeca5ba3c7b /test/rexml/parser
parent4c1fa1a6a4365c792635b53c5f34f098710c5a4f (diff)
* lib/rexml/parsers/treeparser.rb (REXML::Parsers::TreeParser#parse):
Add source information to parse exception on no close tag error. [Bug #8844] [ruby-dev:47672] Patch by Ippei Obayashi. Thanks!!! * test/rexml/parser/test_tree.rb: Add a test for the above case. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42815 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/rexml/parser')
-rw-r--r--test/rexml/parser/test_tree.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/rexml/parser/test_tree.rb b/test/rexml/parser/test_tree.rb
index 7720e95..6754e6b 100644
--- a/test/rexml/parser/test_tree.rb
+++ b/test/rexml/parser/test_tree.rb
@@ -17,6 +17,19 @@ Last 80 unconsumed characters:
MESSAGE
end
+ def test_no_close_tag
+ xml = "<root>"
+ exception = assert_raise(REXML::ParseException) do
+ parse(xml)
+ end
+ assert_equal(<<-MESSAGE, exception.to_s)
+No close tag for /root
+Line: 1
+Position: #{xml.bytesize}
+Last 80 unconsumed characters:
+ MESSAGE
+ end
+
private
def parse(xml)
document = REXML::Document.new