Commit 82d6bc7d authored by Stefan Behnel's avatar Stefan Behnel

extended test cases

parent 19fee9ac
......@@ -37,6 +37,15 @@ __doc__ = u"""
1
>>> n('xxx')
0
>>> p(1)
0
>>> p('a')
1
>>> q(1)
Traceback (most recent call last):
TypeError: 'NoneType' object is not iterable
"""
def f(a,b):
......@@ -68,3 +77,13 @@ def m(int a):
def n(a):
cdef int result = a.lower() in [u'a *',u'b *',u'c *',u'd *']
return result
def p(a):
cdef dict d = {u'a': 1, u'b': 2}
cdef int result = a in d
return result
def q(a):
cdef dict d = None
cdef int result = a in d # should fail with a TypeError
return result
......@@ -37,6 +37,15 @@ __doc__ = u"""
0
>>> n('xxx')
1
>>> p('a')
0
>>> p(1)
1
>>> q(1)
Traceback (most recent call last):
TypeError: 'NoneType' object is not iterable
"""
def f(a,b):
......@@ -68,3 +77,13 @@ def m(int a):
def n(a):
cdef int result = a.lower() not in [u'a *',u'b *',u'c *',u'd *']
return result
def p(a):
cdef dict d = {u'a': 1, u'b': 2}
cdef int result = a not in d
return result
def q(a):
cdef dict d = None
cdef int result = a not in d # should fail with a TypeError
return result
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment