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
d62480c2
Commit
d62480c2
authored
May 16, 2015
by
da_woods
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added a few more tests for the C++ standard library
These relate to non-member binary operators
parent
f1930c2d
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
0 deletions
+20
-0
tests/run/libcpp_all.pyx
tests/run/libcpp_all.pyx
+20
-0
No files found.
tests/run/libcpp_all.pyx
View file @
d62480c2
...
...
@@ -91,3 +91,23 @@ cdef const_vector_to_list(const vector[double]& cv):
lst
.
append
(
cython
.
operator
.
dereference
(
iter
))
cython
.
operator
.
preincrement
(
iter
)
return
lst
def
complex_operators
():
"""
>>> complex_operators()
[-1.0, 0.0, 0.0, 2.0, 0.0, 2.0]
"""
cdef
libcpp
.
complex
.
complex
[
double
]
a
=
libcpp
.
complex
.
complex
[
double
](
0.0
,
1.0
)
cdef
libcpp
.
complex
.
complex
[
double
]
r1
=
a
*
a
cdef
libcpp
.
complex
.
complex
[
double
]
r2
=
a
*
2.0
cdef
libcpp
.
complex
.
complex
[
double
]
r3
=
2.0
*
a
return
[
r1
.
real
(),
r1
.
imag
(),
r2
.
real
(),
r2
.
imag
(),
r3
.
real
(),
r3
.
imag
()]
def
pair_comparison
():
"""
>>> pair_comparison()
[False, True, False, True, False]
"""
cdef
pair
[
double
,
double
]
p1
=
pair
[
double
,
double
](
1.0
,
2.0
)
cdef
pair
[
double
,
double
]
p2
=
pair
[
double
,
double
](
2.0
,
2.0
)
return
[
p1
==
p2
,
p1
==
p1
,
p1
>
p2
,
p1
<
p2
,
p2
>
p2
]
\ No newline at end of file
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