[pypy-svn] r44535 - pypy/dist/pypy/rlib/parsing/test
cfbolz at codespeak.net
cfbolz at codespeak.net
Tue Jun 26 00:41:40 CEST 2007
Author: cfbolz
Date: Tue Jun 26 00:41:40 2007
New Revision: 44535
Modified:
pypy/dist/pypy/rlib/parsing/test/test_pypackrat.py
Log:
another test for good errors
Modified: pypy/dist/pypy/rlib/parsing/test/test_pypackrat.py
==============================================================================
--- pypy/dist/pypy/rlib/parsing/test/test_pypackrat.py (original)
+++ pypy/dist/pypy/rlib/parsing/test/test_pypackrat.py Tue Jun 26 00:41:40 2007
@@ -268,6 +268,21 @@
assert excinfo.value.error.pos == 2
assert excinfo.value.error.expected == ['b']
+ def test_error_success(self):
+ class parser(PackratParser):
+ """
+ b:
+ bstar !__any__;
+ bstar:
+ 'b'*;
+ """
+ print parser._code
+ p = parser("bbc")
+ print parser._code
+ excinfo = py.test.raises(BacktrackException, p.b)
+ assert excinfo.value.error.pos == 2
+ assert excinfo.value.error.expected == ['b']
+
def test_leftrecursion(self):
class parser(PackratParser):
"""
More information about the Pypy-commit
mailing list