[pypy-svn] r14062 - pypy/branch/pycompiler/module/recparser/test

adim at codespeak.net adim at codespeak.net
Fri Jul 1 20:47:14 CEST 2005


Author: adim
Date: Fri Jul  1 20:47:12 2005
New Revision: 14062

Modified:
   pypy/branch/pycompiler/module/recparser/test/test_samples.py
Log:
fixed tests to match the new API

Modified: pypy/branch/pycompiler/module/recparser/test/test_samples.py
==============================================================================
--- pypy/branch/pycompiler/module/recparser/test/test_samples.py	(original)
+++ pypy/branch/pycompiler/module/recparser/test/test_samples.py	Fri Jul  1 20:47:12 2005
@@ -50,13 +50,19 @@
         grammar.USE_LOOKAHEAD = use_lookahead
         for fname in os.listdir(samples_dir):
             if not fname.endswith('.py'):
+            # if fname != 'snippet_simple_assignment.py':
                 continue
             abspath = osp.join(samples_dir, fname)
             yield check_parse, abspath
         
 def check_parse(filepath):
-    print "Testing:", filepath
-    pypy_tuples = pypy_parse(filepath)
+    # pypy_tuples = pypy_parse(filepath)
+    encoding_decl, stack_element, encoding = pypy_parse(filepath)
+    nested_tuples = stack_element.as_tuple()
+    if encoding is None:
+        pypy_tuples = nested_tuples
+    else:
+        pypy_tuples = (encoding_decl, nested_tuples, encoding)
     python_tuples = python_parse(filepath)
     try:
         assert_tuples_equal(pypy_tuples, python_tuples)



More information about the Pypy-commit mailing list