Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Gwenaël Samain
cython
Commits
56d59182
Commit
56d59182
authored
Feb 16, 2008
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
new tests for 'in' operator
parent
32b9adc9
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
86 additions
and
0 deletions
+86
-0
tests/run/inop.pyx
tests/run/inop.pyx
+43
-0
tests/run/notinop.pyx
tests/run/notinop.pyx
+43
-0
No files found.
tests/run/inop.pyx
0 → 100644
View file @
56d59182
__doc__
=
"""
>>> f(1,[1,2,3])
True
>>> f(5,[1,2,3])
False
>>> f(2,(1,2,3))
True
>>> g(1,[1,2,3])
1
>>> g(5,[1,2,3])
0
>>> g(2,(1,2,3))
1
>>> h([1,2,3,4])
True
>>> h([1,3,4])
False
>>> j([1,2,3,4])
1
>>> j([1,3,4])
0
"""
def
f
(
a
,
b
):
result
=
a
in
b
return
result
def
g
(
a
,
b
):
cdef
int
result
result
=
a
in
b
return
result
def
h
(
b
):
result
=
2
in
b
return
result
def
j
(
b
):
cdef
int
result
result
=
2
in
b
return
result
tests/run/notinop.pyx
0 → 100644
View file @
56d59182
__doc__
=
"""
>>> f(1,[1,2,3])
False
>>> f(5,[1,2,3])
True
>>> f(2,(1,2,3))
False
>>> g(1,[1,2,3])
0
>>> g(5,[1,2,3])
1
>>> g(2,(1,2,3))
0
>>> h([1,2,3,4])
False
>>> h([1,3,4])
True
>>> j([1,2,3,4])
0
>>> j([1,3,4])
1
"""
def
f
(
a
,
b
):
result
=
a
not
in
b
return
result
def
g
(
a
,
b
):
cdef
int
result
result
=
a
not
in
b
return
result
def
h
(
b
):
result
=
2
not
in
b
return
result
def
j
(
b
):
cdef
int
result
result
=
2
not
in
b
return
result
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment