[pypy-svn] r18015 - in pypy/dist/pypy/module/recparser: . test

pedronis at codespeak.net pedronis at codespeak.net
Fri Sep 30 21:11:11 CEST 2005


Author: pedronis
Date: Fri Sep 30 21:11:09 2005
New Revision: 18015

Added:
   pypy/dist/pypy/module/recparser/test/
   pypy/dist/pypy/module/recparser/test/test_parser.py   (contents, props changed)
Modified:
   pypy/dist/pypy/module/recparser/pyparser.py
Log:
some very minimal sanity check tests for recparser

fix to have them pass (enc_minimal was crashing on missing space attr on the builder)



Modified: pypy/dist/pypy/module/recparser/pyparser.py
==============================================================================
--- pypy/dist/pypy/module/recparser/pyparser.py	(original)
+++ pypy/dist/pypy/module/recparser/pyparser.py	Fri Sep 30 21:11:09 2005
@@ -145,6 +145,7 @@
 
 def parse_python_source(space, source, goal):
     builder = grammar.BaseGrammarBuilder(debug=False, rules=PYTHON_PARSER.rules)
+    builder.space = space
     try:
         PYTHON_PARSER.parse_source(source, goal, builder )
         return builder.stack[-1]

Added: pypy/dist/pypy/module/recparser/test/test_parser.py
==============================================================================
--- (empty file)
+++ pypy/dist/pypy/module/recparser/test/test_parser.py	Fri Sep 30 21:11:09 2005
@@ -0,0 +1,17 @@
+from pypy.objspace.std import StdObjSpace 
+
+def setup_module(mod): 
+    mod.space = StdObjSpace(usemodules=['recparser'])
+
+
+class AppTestRecparser: 
+    def setup_class(cls):
+        cls.space = space
+
+    def test_simple(self):
+        import parser
+        parser.suite("great()")
+
+    def test_enc_minimal(self):
+        import parser
+        parser.suite("# -*- coding: koi8-u -*-*\ngreat()")



More information about the Pypy-commit mailing list