summaryrefslogtreecommitdiff
path: root/test/psych/test_parser.rb
diff options
context:
space:
mode:
authortenderlove <tenderlove@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-01-22 02:23:12 +0000
committertenderlove <tenderlove@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-01-22 02:23:12 +0000
commit7b876e65ed79d9ca4a22f7731a463ee30e35b30b (patch)
tree3f4701836a55e4af73e30e4761a22c0c341c5234 /test/psych/test_parser.rb
parentcab95ab7126e69b6b461c38a342194f833512439 (diff)
* ext/psych/parser.c (parse): fixing off-by-one error on line numbers
in parse exceptions. [ruby-core:34690] * test/psych/test_parser.rb: test for error git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30628 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/psych/test_parser.rb')
-rw-r--r--test/psych/test_parser.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/psych/test_parser.rb b/test/psych/test_parser.rb
index a60a0c6..3894ead 100644
--- a/test/psych/test_parser.rb
+++ b/test/psych/test_parser.rb
@@ -155,6 +155,21 @@ module Psych
assert_match "(#{io.path}):", e.message
end
+ # ruby-core:34690
+ def test_exception_line
+ e = assert_raises(Psych::SyntaxError) do
+ @parser.parse(<<-eoyaml)
+# based on "SGML/XML character entity reference" at http://www.bitjungle.com/isoent/
+#
+---
+#DOUBLE LOW-9 QUOTATION MARK
+#requires fontenc:T1
+ldquor: ,,
+ eoyaml
+ end
+ assert_match 'line 6', e.message
+ end
+
def test_mapping_end
@parser.parse("---\n!!map { key: value }")
assert_called :end_mapping