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
b60d65e2
Commit
b60d65e2
authored
Mar 13, 2010
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Py3 test fix
parent
f4e2ceb8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
26 deletions
+29
-26
tests/run/cpp_operators.pyx
tests/run/cpp_operators.pyx
+29
-26
No files found.
tests/run/cpp_operators.pyx
View file @
b60d65e2
cimport
cython.operator
cimport
cython.operator
from
cython.operator
cimport
dereference
as
deref
from
cython.operator
cimport
dereference
as
deref
cdef
out
(
s
):
print
s
.
decode
(
'ASCII'
)
cdef
extern
from
"cpp_operators_helper.h"
:
cdef
extern
from
"cpp_operators_helper.h"
:
cdef
cppclass
TestOps
:
cdef
cppclass
TestOps
:
...
@@ -46,10 +49,10 @@ def test_unops():
...
@@ -46,10 +49,10 @@ def test_unops():
unary *
unary *
"""
"""
cdef
TestOps
*
t
=
new
TestOps
()
cdef
TestOps
*
t
=
new
TestOps
()
print
+
t
[
0
]
out
(
+
t
[
0
])
print
-
t
[
0
]
out
(
-
t
[
0
])
print
~
t
[
0
]
out
(
~
t
[
0
])
print
deref
(
t
[
0
]
)
out
(
deref
(
t
[
0
])
)
del
t
del
t
def
test_incdec
():
def
test_incdec
():
...
@@ -61,10 +64,10 @@ def test_incdec():
...
@@ -61,10 +64,10 @@ def test_incdec():
post --
post --
"""
"""
cdef
TestOps
*
t
=
new
TestOps
()
cdef
TestOps
*
t
=
new
TestOps
()
print
cython
.
operator
.
preincrement
(
t
[
0
]
)
out
(
cython
.
operator
.
preincrement
(
t
[
0
])
)
print
cython
.
operator
.
predecrement
(
t
[
0
]
)
out
(
cython
.
operator
.
predecrement
(
t
[
0
])
)
print
cython
.
operator
.
postincrement
(
t
[
0
]
)
out
(
cython
.
operator
.
postincrement
(
t
[
0
])
)
print
cython
.
operator
.
postdecrement
(
t
[
0
]
)
out
(
cython
.
operator
.
postdecrement
(
t
[
0
])
)
del
t
del
t
def
test_binop
():
def
test_binop
():
...
@@ -82,18 +85,18 @@ def test_binop():
...
@@ -82,18 +85,18 @@ def test_binop():
binary >>
binary >>
"""
"""
cdef
TestOps
*
t
=
new
TestOps
()
cdef
TestOps
*
t
=
new
TestOps
()
print
t
[
0
]
+
1
out
(
t
[
0
]
+
1
)
print
t
[
0
]
-
1
out
(
t
[
0
]
-
1
)
print
t
[
0
]
*
1
out
(
t
[
0
]
*
1
)
print
t
[
0
]
/
1
out
(
t
[
0
]
/
1
)
print
t
[
0
]
%
1
out
(
t
[
0
]
%
1
)
print
t
[
0
]
&
1
out
(
t
[
0
]
&
1
)
print
t
[
0
]
|
1
out
(
t
[
0
]
|
1
)
print
t
[
0
]
^
1
out
(
t
[
0
]
^
1
)
print
t
[
0
]
<<
1
out
(
t
[
0
]
<<
1
)
print
t
[
0
]
>>
1
out
(
t
[
0
]
>>
1
)
del
t
del
t
def
test_cmp
():
def
test_cmp
():
...
@@ -107,12 +110,12 @@ def test_cmp():
...
@@ -107,12 +110,12 @@ def test_cmp():
binary <
binary <
"""
"""
cdef
TestOps
*
t
=
new
TestOps
()
cdef
TestOps
*
t
=
new
TestOps
()
print
t
[
0
]
==
1
out
(
t
[
0
]
==
1
)
print
t
[
0
]
!=
1
out
(
t
[
0
]
!=
1
)
print
t
[
0
]
>=
1
out
(
t
[
0
]
>=
1
)
print
t
[
0
]
>
1
out
(
t
[
0
]
>
1
)
print
t
[
0
]
<=
1
out
(
t
[
0
]
<=
1
)
print
t
[
0
]
<
1
out
(
t
[
0
]
<
1
)
del
t
del
t
def
test_index_call
():
def
test_index_call
():
...
@@ -122,6 +125,6 @@ def test_index_call():
...
@@ -122,6 +125,6 @@ def test_index_call():
binary ()
binary ()
"""
"""
cdef
TestOps
*
t
=
new
TestOps
()
cdef
TestOps
*
t
=
new
TestOps
()
print
t
[
0
][
100
]
out
(
t
[
0
][
100
])
print
t
[
0
](
100
)
out
(
t
[
0
](
100
)
)
del
t
del
t
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