summaryrefslogtreecommitdiff
path: root/test/psych/test_parser.rb
diff options
context:
space:
mode:
authortenderlove <tenderlove@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-01-22 01:13:52 +0000
committertenderlove <tenderlove@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-01-22 01:13:52 +0000
commit0331314d278d0590ff26eb7ec156f859b590464f (patch)
tree47060a334fc4212a01f49a960af4497f499a4137 /test/psych/test_parser.rb
parent960720ef4fd9662d94bbc25d5a6cfcaa313450a3 (diff)
* ext/psych/parser.c (parse): fix assertion error when reusing a
parser after an exception has been raised * test/psych/test_parser.rb: test for assertion error git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30625 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/psych/test_parser.rb')
-rw-r--r--test/psych/test_parser.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/psych/test_parser.rb b/test/psych/test_parser.rb
index cd22914..ca69b1a 100644
--- a/test/psych/test_parser.rb
+++ b/test/psych/test_parser.rb
@@ -128,6 +128,16 @@ module Psych
end
end
+ def test_syntax_error_twice
+ assert_raises(Psych::SyntaxError) do
+ @parser.parse("---\n\"foo\"\n\"bar\"\n")
+ end
+
+ assert_raises(Psych::SyntaxError) do
+ @parser.parse("---\n\"foo\"\n\"bar\"\n")
+ end
+ end
+
def test_mapping_end
@parser.parse("---\n!!map { key: value }")
assert_called :end_mapping