summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2007-05-25 00:31:28 +0000
committerluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2007-05-25 00:31:28 +0000
commit62a4d4c91df2aa6e7a6f28dfdf81f95f28987216 (patch)
tree324aaf518981a1c6d4bf75b54c2119a82d76c0cf /test
parent2b372df7038a268eee31372f62e8cf6be989b09e (diff)
Adding better error reporting on unmatched brackets -- you will now get notification of what was expected in most cases
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2531 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'test')
-rwxr-xr-xtest/language/lexer.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/language/lexer.rb b/test/language/lexer.rb
index bb2cc8d66..7b4909fb1 100755
--- a/test/language/lexer.rb
+++ b/test/language/lexer.rb
@@ -242,6 +242,18 @@ class TestLexer < Test::Unit::TestCase
end
end
end
+
+ # Make sure the expected stack works as it should
+ def test_expected
+ @lexer.string = "[a{"
+ expected = @lexer.instance_variable_get("@expected")
+ @lexer.scan {}
+ assert_equal("}", @lexer.expected, "expected value is wrong")
+
+ @lexer.string = "}"
+ @lexer.scan {}
+ assert_equal("]", @lexer.expected, "expected value is wrong after pop")
+ end
end
# $Id$