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
f6e9bcc2
Commit
f6e9bcc2
authored
Mar 19, 2016
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
extend test
parent
87dc8089
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
0 deletions
+13
-0
tests/run/if_else_expr.pyx
tests/run/if_else_expr.pyx
+13
-0
No files found.
tests/run/if_else_expr.pyx
View file @
f6e9bcc2
...
...
@@ -9,6 +9,7 @@ cdef class Foo:
def
__repr__
(
self
):
return
'<Foo>'
cpdef
test_type_cast
(
Foo
obj
,
cond
):
"""
# Regression test: obj must be cast to (PyObject *) here
...
...
@@ -42,3 +43,15 @@ def test_charptr_coercion(x):
"""
cdef
char
*
s
=
b'abc'
if
x
else
b'def'
return
s
.
decode
(
'ascii'
)
def
test_syntax
():
"""
>>> test_syntax()
(0, 0, 0)
"""
# Py3 allows the 'else' keyword to directly follow a number
x
=
0
if
1
else
1
y
=
0
if
1.0
else
1
z
=
0
if
1.
else
1
return
x
,
y
,
z
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