From 0331314d278d0590ff26eb7ec156f859b590464f Mon Sep 17 00:00:00 2001 From: tenderlove Date: Sat, 22 Jan 2011 01:13:52 +0000 Subject: * 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 --- test/psych/test_parser.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'test') diff --git a/test/psych/test_parser.rb b/test/psych/test_parser.rb index cd22914d3b..ca69b1a1e3 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 -- cgit v1.2.3