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
ccd3ee5a
Commit
ccd3ee5a
authored
Feb 13, 2013
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add test case for more complex compile time expression and add tree assertions to others
parent
7cec62b7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
0 deletions
+18
-0
tests/run/ct_DEF.pyx
tests/run/ct_DEF.pyx
+18
-0
No files found.
tests/run/ct_DEF.pyx
View file @
ccd3ee5a
cimport
cython
__doc__
=
u"""
>>> s()
b'spam'
...
...
@@ -25,6 +28,7 @@ DEF TRUE = TRUE_FALSE[0]
DEF
FALSE
=
TRUE_FALSE
[
1
]
DEF
INT_TUPLE1
=
TUPLE
[:
2
]
DEF
INT_TUPLE2
=
TUPLE
[
1
:
4
:
2
]
DEF
EXPRESSION
=
int
(
float
(
2
*
2
))
+
int
(
str
(
2
))
+
int
(
max
(
1
,
2
,
3
))
+
sum
([
TWO
,
FIVE
])
def
c
():
"""
...
...
@@ -89,6 +93,7 @@ def s():
cdef
char
*
s
=
STR
return
s
@
cython
.
test_assert_path_exists
(
'//TupleNode'
)
def
constant_tuple
():
"""
>>> constant_tuple()
...
...
@@ -97,6 +102,7 @@ def constant_tuple():
cdef
object
t
=
TUPLE
return
t
@
cython
.
test_assert_path_exists
(
'//IntNode'
)
def
tuple_indexing
():
"""
>>> tuple_indexing()
...
...
@@ -121,6 +127,7 @@ def five():
cdef
int
five
=
FIVE
return
five
@
cython
.
test_assert_path_exists
(
'//BoolNode'
)
def
true
():
"""
>>> true()
...
...
@@ -129,6 +136,7 @@ def true():
cdef
bint
true
=
TRUE
return
true
@
cython
.
test_assert_path_exists
(
'//BoolNode'
)
def
false
():
"""
>>> false()
...
...
@@ -136,3 +144,13 @@ def false():
"""
cdef
bint
false
=
FALSE
return
false
@
cython
.
test_assert_path_exists
(
'//IntNode'
)
@
cython
.
test_fail_if_path_exists
(
'//AddNode'
)
def
expression
():
"""
>>> expression()
16
"""
cdef
int
i
=
EXPRESSION
return
i
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