extended test case
authorStefan Behnel <scoder@users.berlios.de>
Tue, 20 Oct 2009 19:02:54 +0000 (21:02 +0200)
committerStefan Behnel <scoder@users.berlios.de>
Tue, 20 Oct 2009 19:02:54 +0000 (21:02 +0200)
tests/run/inop.pyx

index 76fbd7767b3c2a13e48fa9f12c2837c3776ba9c5..49e8af381da82d5cbf03a024f643ca1b0ff93142 100644 (file)
@@ -46,6 +46,15 @@ __doc__ = u"""
     >>> q(1)
     Traceback (most recent call last):
     TypeError: 'NoneType' object is not iterable
+
+    >>> l = [1,2,3,4]
+    >>> l2 = [l[1:],l[:-1],l]
+    >>> 2 in l in l2
+    True
+    >>> r(2)
+    1
+    >>> s(2)
+    1
 """
 
 def f(a,b):
@@ -87,3 +96,13 @@ def q(a):
     cdef dict d = None
     cdef int result = a in d # should fail with a TypeError
     return result
+
+def r(a):
+    l = [1,2,3,4]
+    l2 = [l[1:],l[:-1],l]
+    cdef int result = a in l in l2
+    return result
+
+def s(a):
+    cdef int result = a in [1,2,3,4] in [[1,2,3],[2,3,4],[1,2,3,4]]
+    return result