Author: Jeremy Thurgood <fir...@gmail.com>
Branch: enumerate-rstr
Changeset: r61555:7563dcd4e19e
Date: 2013-02-21 19:14 +0200
http://bitbucket.org/pypy/pypy/changeset/7563dcd4e19e/

Log:    Some tests for enumerating rstrs.

diff --git a/rpython/annotator/test/test_annrpython.py 
b/rpython/annotator/test/test_annrpython.py
--- a/rpython/annotator/test/test_annrpython.py
+++ b/rpython/annotator/test/test_annrpython.py
@@ -3585,6 +3585,26 @@
         s = a.build_types(f, [])
         assert isinstance(s, annmodel.SomeChar)
 
+    def test_enumerate_str(self):
+        def f():
+            for i, x in enumerate('abcd'):
+                if i == 2:
+                    return x
+            return '?'
+        a = self.RPythonAnnotator()
+        s = a.build_types(f, [])
+        assert isinstance(s, annmodel.SomeChar)
+
+    def test_enumerate_unicode(self):
+        def f():
+            for i, x in enumerate(u'abcd'):
+                if i == 2:
+                    return x
+            return '?'
+        a = self.RPythonAnnotator()
+        s = a.build_types(f, [])
+        assert isinstance(s, annmodel.SomeUnicodeCodePoint)
+
     def test_context_manager(self):
         class C:
             def __init__(self):
_______________________________________________
pypy-commit mailing list
pypy-commit@python.org
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to