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
253ed803
Commit
253ed803
authored
Mar 23, 2009
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test for constant folding on character literals
parent
f5e48999
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
4 deletions
+9
-4
tests/run/consts.pyx
tests/run/consts.pyx
+9
-4
No files found.
tests/run/consts.pyx
View file @
253ed803
...
@@ -5,10 +5,12 @@ True
...
@@ -5,10 +5,12 @@ True
True
True
>>> neg() == -1 -2 - (-3+4)
>>> neg() == -1 -2 - (-3+4)
True
True
>>> int_mix() == 1 + (2 * 3) // 2
>>>
long_
int_mix() == 1 + (2 * 3) // 2
True
True
>>> if IS_PY3: type(int_mix()) is int
>>> if IS_PY3: type(long_int_mix()) is int
... else: type(int_mix()) is long
... else: type(long_int_mix()) is long
True
>>> char_int_mix() == 1 + (ord(' ') * 3) // 2 + ord('A')
True
True
>>> int_cast() == 1 + 2 * 6000
>>> int_cast() == 1 + 2 * 6000
True
True
...
@@ -37,9 +39,12 @@ def add_var(a):
...
@@ -37,9 +39,12 @@ def add_var(a):
def
neg
():
def
neg
():
return
-
1
-
2
-
(
-
3
+
4
)
return
-
1
-
2
-
(
-
3
+
4
)
def
int_mix
():
def
long_
int_mix
():
return
1L
+
(
2
*
3L
)
//
2
return
1L
+
(
2
*
3L
)
//
2
def
char_int_mix
():
return
1L
+
(
c
' '
*
3L
)
//
2
+
c
'A'
def
int_cast
():
def
int_cast
():
return
<
int
>
(
1
+
2
*
6000
)
return
<
int
>
(
1
+
2
*
6000
)
...
...
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