[pypy-svn] r57943 - pypy/branch/tuple-nonresizable-395/pypy/annotation/test

fijal at codespeak.net fijal at codespeak.net
Sun Sep 7 13:24:39 CEST 2008


Author: fijal
Date: Sun Sep  7 13:24:37 2008
New Revision: 57943

Modified:
   pypy/branch/tuple-nonresizable-395/pypy/annotation/test/test_annrpython.py
Log:
another test for never_resize


Modified: pypy/branch/tuple-nonresizable-395/pypy/annotation/test/test_annrpython.py
==============================================================================
--- pypy/branch/tuple-nonresizable-395/pypy/annotation/test/test_annrpython.py	(original)
+++ pypy/branch/tuple-nonresizable-395/pypy/annotation/test/test_annrpython.py	Sun Sep  7 13:24:37 2008
@@ -3062,6 +3062,21 @@
         py.test.raises(TooLateForChange, a.build_types, g, [])
         assert called
 
+    def test_listitem_never_resize(self):
+        from pypy.rlib.debug import check_annotation
+
+        def checker(ann, bk):
+            ann.listdef.never_resize()
+
+        def f():
+            l = [1,2,3]
+            l.append(4)
+            check_annotation(l, checker)
+
+        a = self.RPythonAnnotator()
+        py.test.raises(TooLateForChange, a.build_types, f, [])
+        
+
 def g(n):
     return [0,1,2,n]
 



More information about the Pypy-commit mailing list