[pypy-svn] r34189 - in pypy/dist/pypy: jit/timeshifter/test lang/automata

rxe at codespeak.net rxe at codespeak.net
Sat Nov 4 17:02:01 CET 2006


Author: rxe
Date: Sat Nov  4 17:01:59 2006
New Revision: 34189

Modified:
   pypy/dist/pypy/jit/timeshifter/test/test_portal.py
   pypy/dist/pypy/lang/automata/dfa.py
Log:
fix the tests - yay it works!  - arigo,rxe

Modified: pypy/dist/pypy/jit/timeshifter/test/test_portal.py
==============================================================================
--- pypy/dist/pypy/jit/timeshifter/test/test_portal.py	(original)
+++ pypy/dist/pypy/jit/timeshifter/test/test_portal.py	Sat Nov  4 17:01:59 2006
@@ -154,18 +154,18 @@
         assert not res
 
     def test_dfa_compile2(self):
-        py.test.skip('wip')
         from pypy.lang.automata.dfa import getautomaton, convertagain, recognizeparts
-        a = getautomaton()
-        def main(gets):
-            alltrans, final_states = convertagain(a)
+        more = [convertagain(getautomaton()), convertagain(getautomaton())]
+        def main(gets, gets2):
+            alltrans, final_states = more[gets2]
             s = ["aaaaaaaaaab", "aaaa"][gets]
             return recognizeparts(alltrans, final_states, s)
 
-        res = self.timeshift_from_portal(main, recognizeparts, [0], policy=P_NOVIRTUAL)
+        res = self.timeshift_from_portal(main, recognizeparts, [0, 0], policy=P_NOVIRTUAL)
         assert res
 
-        res = self.timeshift_from_portal(main, recognizeparts, [1], policy=P_NOVIRTUAL)
+        # XXX unfortunately we have to create a new version each time - because of pbc
+        res = self.timeshift_from_portal(main, recognizeparts, [1, 0], policy=P_NOVIRTUAL)
         assert not res
 
     def test_method_call_promote(self):

Modified: pypy/dist/pypy/lang/automata/dfa.py
==============================================================================
--- pypy/dist/pypy/lang/automata/dfa.py	(original)
+++ pypy/dist/pypy/lang/automata/dfa.py	Sat Nov  4 17:01:59 2006
@@ -130,5 +130,6 @@
         indx += 1
         
     res = state in finals
+    res = hint(res, concrete=True)
     res = hint(res, variable=True)
     return res



More information about the Pypy-commit mailing list