From: Stefan Behnel Date: Tue, 20 Oct 2009 19:02:54 +0000 (+0200) Subject: extended test case X-Git-Tag: 0.13.beta0~2^2~121^2~6 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=e15eb5611e612528b3b1bbc7dd9ff9a576d14d65;p=cython.git extended test case --- diff --git a/tests/run/inop.pyx b/tests/run/inop.pyx index 76fbd776..49e8af38 100644 --- a/tests/run/inop.pyx +++ b/tests/run/inop.pyx @@ -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