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
e8270ec2
Commit
e8270ec2
authored
May 17, 2019
by
gsamain
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Correct cypclass tests to validate doctest
parent
eed1e4d9
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
39 additions
and
18 deletions
+39
-18
tests/run/cypclass_test___new__.pyx
tests/run/cypclass_test___new__.pyx
+5
-2
tests/run/cypclass_test_basic.pyx
tests/run/cypclass_test_basic.pyx
+1
-1
tests/run/cypclass_test_constructor.pyx
tests/run/cypclass_test_constructor.pyx
+3
-2
tests/run/cypclass_test_constructor_optional_arguments.pyx
tests/run/cypclass_test_constructor_optional_arguments.pyx
+3
-2
tests/run/cypclass_test_inheritance.pyx
tests/run/cypclass_test_inheritance.pyx
+4
-2
tests/run/cypclass_test_keywordnew.pyx
tests/run/cypclass_test_keywordnew.pyx
+1
-1
tests/run/cypclass_test_multiple_inheritance.pyx
tests/run/cypclass_test_multiple_inheritance.pyx
+7
-2
tests/run/cypclass_test_templates.pyx
tests/run/cypclass_test_templates.pyx
+5
-2
tests/run/cypclass_test_type_inference.pyx
tests/run/cypclass_test_type_inference.pyx
+4
-2
tests/run/cypclass_test_typecast.pyx
tests/run/cypclass_test_typecast.pyx
+6
-2
No files found.
tests/run/cypclass_test___new__.pyx
View file @
e8270ec2
...
...
@@ -78,6 +78,9 @@ cdef double baa():
cpdef
bag
():
"""
>>> bag()
-1
\
n
3
\
n
32
\
n
6.8
-1
3
32
6.8
"""
return
str
(
foo
())
+
'
\
n
'
+
str
(
bar
())
+
'
\
n
'
+
str
(
baz
())
+
'
\
n
'
+
str
(
baa
())
print
str
(
foo
())
+
'
\
n
'
+
str
(
bar
())
+
'
\
n
'
+
str
(
baz
())
+
'
\
n
'
+
str
(
baa
())
tests/run/cypclass_test_basic.pyx
View file @
e8270ec2
...
...
@@ -16,4 +16,4 @@ def bag():
>>> bag()
3
"""
return
str
(
foo
())
\ No newline at end of file
print
str
(
foo
())
tests/run/cypclass_test_constructor.pyx
View file @
e8270ec2
...
...
@@ -21,6 +21,7 @@ cpdef bar():
def
bag
():
"""
>>> bag()
3
\
n
14
3
14
"""
return
str
(
foo
())
+
'
\
n
'
+
str
(
bar
())
print
str
(
foo
())
+
'
\
n
'
+
str
(
bar
())
tests/run/cypclass_test_constructor_optional_arguments.pyx
View file @
e8270ec2
...
...
@@ -19,6 +19,7 @@ cpdef bar():
def
bag
():
"""
>>> bag()
3
\
n
14
3
14
"""
return
str
(
foo
())
+
'
\
n
'
+
str
(
bar
())
print
str
(
foo
())
+
'
\
n
'
+
str
(
bar
())
tests/run/cypclass_test_inheritance.pyx
View file @
e8270ec2
...
...
@@ -33,6 +33,8 @@ cpdef baz():
def
bag
():
"""
>>> bag()
14
\
n
9
\
n
2
14
9
2
"""
return
str
(
foo
())
+
'
\
n
'
+
str
(
bar
())
+
'
\
n
'
+
str
(
baz
())
print
str
(
foo
())
+
'
\
n
'
+
str
(
bar
())
+
'
\
n
'
+
str
(
baz
())
tests/run/cypclass_test_keywordnew.pyx
View file @
e8270ec2
...
...
@@ -16,4 +16,4 @@ def bag():
>>> bag()
3
"""
return
str
(
foo
())
\ No newline at end of file
print
str
(
foo
())
tests/run/cypclass_test_multiple_inheritance.pyx
View file @
e8270ec2
...
...
@@ -32,12 +32,17 @@ cdef cypclass C(A,B):
cpdef
bag
():
"""
>>> bag()
3
\
n
4
\
n
8
\
n
1
\
n
8
\
n
1
3
4
8
1
8
1
"""
a
=
A
(
3
)
b
=
B
(
4
)
c
=
C
(
5
)
c
+=
a
c
-=
b
return
str
(
a
.
a
)
+
'
\
n
'
+
str
(
b
.
b
)
+
'
\
n
'
+
str
(
c
.
a
)
+
'
\
n
'
+
str
(
c
.
b
)
\
print
str
(
a
.
a
)
+
'
\
n
'
+
str
(
b
.
b
)
+
'
\
n
'
+
str
(
c
.
a
)
+
'
\
n
'
+
str
(
c
.
b
)
\
+
'
\
n
'
+
str
(
A
.
getter
(
c
))
+
'
\
n
'
+
str
(
B
.
getter
(
c
))
tests/run/cypclass_test_templates.pyx
View file @
e8270ec2
...
...
@@ -19,9 +19,12 @@ cdef cypclass SomeMemory[T, U]:
cpdef
bag
():
"""
>>> bag()
1
\
n
2.3
\
n
1
\
n
2.3
1
2.3
1
2.3
"""
cdef
SomeMemory
[
int
,
double
]
o
=
SomeMemory
[
int
,
double
](
1
,
2.3
)
cdef
SomeMemory
[
int
,
int
]
b
=
new
SomeMemory
[
int
,
int
]()
del
b
return
str
(
o
.
a
)
+
'
\
n
'
+
str
(
o
.
b
)
+
'
\
n
'
+
str
(
o
.
first
())
+
'
\
n
'
+
str
(
o
.
second
())
print
str
(
o
.
a
)
+
'
\
n
'
+
str
(
o
.
b
)
+
'
\
n
'
+
str
(
o
.
first
())
+
'
\
n
'
+
str
(
o
.
second
())
tests/run/cypclass_test_type_inference.pyx
View file @
e8270ec2
...
...
@@ -24,7 +24,9 @@ cdef cypclass SomeSubMemory(SomeMemory):
cpdef
bag
():
"""
>>> bag()
28
\
n
4
\
n
7
28
4
7
"""
o1
=
SomeMemory
()
o2
=
SomeMemory
(
4
)
...
...
@@ -32,4 +34,4 @@ cpdef bag():
o3
+=
o2
o1
=
o2
*
o3
return
str
(
o1
.
a
)
+
'
\
n
'
+
str
(
o2
.
a
)
+
'
\
n
'
+
str
(
o3
.
a
)
print
str
(
o1
.
a
)
+
'
\
n
'
+
str
(
o2
.
a
)
+
'
\
n
'
+
str
(
o3
.
a
)
tests/run/cypclass_test_typecast.pyx
View file @
e8270ec2
...
...
@@ -28,10 +28,14 @@ cdef cypclass SomeWrapper:
cpdef
bag
():
"""
>>> bag()
-1
\
n
4294967295
\
n
True
\
n
3
\
n
False
-1
4294967295
True
3
False
"""
cdef
SomeMemory
o
=
SomeMemory
()
o
.
a
=
-
1
cdef
SomeWrapper
w
=
SomeWrapper
(
3
)
return
str
(
<
int
>
o
)
+
'
\
n
'
+
str
(
<
unsigned
int
>
o
)
+
'
\
n
'
+
str
(
<
bint
>
o
)
\
print
str
(
<
int
>
o
)
+
'
\
n
'
+
str
(
<
unsigned
int
>
o
)
+
'
\
n
'
+
str
(
<
bint
>
o
)
\
+
'
\
n
'
+
str
(
<
int
>
<
SomeMemory
>
w
)
+
'
\
n
'
+
str
(
<
bint
>
<
SomeMemory
>
w
)
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