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
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
nexedi
cython
Commits
819991ce
Commit
819991ce
authored
May 04, 2010
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
several test cases for ticket 145
parent
5ced0c3f
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
108 additions
and
1 deletion
+108
-1
tests/bugs.txt
tests/bugs.txt
+2
-1
tests/run/bint_binop_T145.pyx
tests/run/bint_binop_T145.pyx
+106
-0
No files found.
tests/bugs.txt
View file @
819991ce
...
...
@@ -9,7 +9,8 @@ missing_baseclass_in_predecl_T262
cfunc_call_tuple_args_T408
cascaded_list_unpacking_T467
compile.cpp_operators
bint_binop_T145
#
Pyrex
regression tests that don't current work:
#
CPython
regression tests that don't current work:
pyregr.test_threadsignals
pyregr.test_module
tests/run/bint_binop_T145.pyx
0 → 100644
View file @
819991ce
def
or_literal_bint
():
"""
>>> True or 5
True
>>> or_literal_bint()
True
"""
return
True
or
5
def
and_literal_bint
():
"""
>>> 5 and True
True
>>> and_literal_bint()
True
"""
return
5
and
True
def
False_and_True_or_0
():
"""
>>> False and True or 0
0
>>> False_and_True_or_0()
0
"""
return
False
and
True
or
0
def
True_and_True_or_0
():
"""
>>> True and True or 0
True
>>> True_and_True_or_0()
True
"""
return
True
and
True
or
0
def
x_and_True_or_False
(
x
):
"""
>>> x_and_True_or_False(0)
False
>>> x_and_True_or_False(1)
True
>>> x_and_True_or_False('abc')
True
>>> x_and_True_or_False([])
False
"""
return
x
and
True
or
False
def
x_and_True_or_0
(
x
):
"""
>>> 0 and True or 0
0
>>> x_and_True_or_0(0)
0
>>> 1 and True or 0
True
>>> x_and_True_or_0(1)
True
>>> x_and_True_or_0('abc')
True
>>> x_and_True_or_0([])
0
"""
return
x
and
True
or
0
def
x_and_True_or_1
(
x
):
"""
>>> 0 and True or 1
1
>>> x_and_True_or_1(0)
1
>>> 1 and True or 1
True
>>> x_and_True_or_1(1)
True
>>> x_and_True_or_1('abc')
True
>>> x_and_True_or_1([])
1
"""
return
x
and
True
or
1
def
x_and_1_or_False
(
x
):
"""
>>> 0 and 1 or False
False
>>> x_and_1_or_False(0)
False
>>> 1 and 1 or False
1
>>> x_and_1_or_False(1)
1
>>> x_and_1_or_False('abc')
1
>>> x_and_1_or_False([])
False
"""
return
x
and
1
or
False
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