Commit e8270ec2 authored by gsamain's avatar gsamain

Correct cypclass tests to validate doctest

parent eed1e4d9
......@@ -78,6 +78,9 @@ cdef double baa():
cpdef bag():
"""
>>> bag()
-1\n3\n32\n6.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())
......@@ -16,4 +16,4 @@ def bag():
>>> bag()
3
"""
return str(foo())
\ No newline at end of file
print str(foo())
......@@ -21,6 +21,7 @@ cpdef bar():
def bag():
"""
>>> bag()
3\n14
3
14
"""
return str(foo()) + '\n' + str(bar())
print str(foo()) + '\n' + str(bar())
......@@ -19,6 +19,7 @@ cpdef bar():
def bag():
"""
>>> bag()
3\n14
3
14
"""
return str(foo()) + '\n' + str(bar())
print str(foo()) + '\n' + str(bar())
......@@ -33,6 +33,8 @@ cpdef baz():
def bag():
"""
>>> bag()
14\n9\n2
14
9
2
"""
return str(foo()) + '\n' + str(bar()) + '\n' + str(baz())
print str(foo()) + '\n' + str(bar()) + '\n' + str(baz())
......@@ -16,4 +16,4 @@ def bag():
>>> bag()
3
"""
return str(foo())
\ No newline at end of file
print str(foo())
......@@ -32,12 +32,17 @@ cdef cypclass C(A,B):
cpdef bag():
"""
>>> bag()
3\n4\n8\n1\n8\n1
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))
......@@ -19,9 +19,12 @@ cdef cypclass SomeMemory[T, U]:
cpdef bag():
"""
>>> bag()
1\n2.3\n1\n2.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())
......@@ -24,7 +24,9 @@ cdef cypclass SomeSubMemory(SomeMemory):
cpdef bag():
"""
>>> bag()
28\n4\n7
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)
......@@ -28,10 +28,14 @@ cdef cypclass SomeWrapper:
cpdef bag():
"""
>>> bag()
-1\n4294967295\nTrue\n3\nFalse
-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)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment