[pypy-svn] r13426 - pypy/dist/pypy/translator/test

arigo at codespeak.net arigo at codespeak.net
Wed Jun 15 02:26:00 CEST 2005


Author: arigo
Date: Wed Jun 15 02:25:58 2005
New Revision: 13426

Modified:
   pypy/dist/pypy/translator/test/test_annrpython.py
Log:
A test for prebuilt lists that are self-recursive.


Modified: pypy/dist/pypy/translator/test/test_annrpython.py
==============================================================================
--- pypy/dist/pypy/translator/test/test_annrpython.py	(original)
+++ pypy/dist/pypy/translator/test/test_annrpython.py	Wed Jun 15 02:25:58 2005
@@ -1336,6 +1336,18 @@
         s = a.build_types(f, [int])
         assert isinstance(s, annmodel.SomeString)
 
+    def test_immutable_recursive_list(self):
+        l = []
+        l.append(l)
+        def f():
+            return l
+        a = self.RPythonAnnotator()
+        s = a.build_types(f, [])
+        assert isinstance(s, annmodel.SomeList)
+        s_item = s.listdef.listitem.s_value
+        assert isinstance(s_item, annmodel.SomeList)
+        assert s_item.listdef.same_as(s.listdef)
+
 
 def g(n):
     return [0,1,2,n]



More information about the Pypy-commit mailing list