Commit 22e13080 authored by Stefan Behnel's avatar Stefan Behnel

loads of test cases

parent b4c9ca28
__doc__ = """
>>> flub(25)
25
>>> g()
0
"""
cdef extern from "altet1.h":
ctypedef int blarg
......@@ -7,3 +14,6 @@ def flub(blarg bobble):
print bobble
globvar = 0
def g():
return globvar
__doc__ = """
>>> test()
1
"""
cdef extern from "hinsen1.h":
ctypedef class spam.Spam [object PySpamObject]:
......@@ -7,4 +12,9 @@ cdef extern from "hinsen1.h":
cdef class SpamAndEggs(Spam):
cdef cook(self):
pass
return 1
def test():
cdef SpamAndEggs s
s = SpamAndEggs()
return s.cook()
cdef extern object g(int x) nogil
cdef extern void g(int x) nogil
cdef void f(int x) nogil:
cdef int y
......
def f(obj1, obj2):
__doc__ = """
>>> f(20)
'20'
>>> f('test')
"'test'"
>>> g()
'42'
"""
def f(obj2):
obj1 = `obj2`
obj1 = `42`
return obj1
def g():
obj1 = `42`
return obj1
......@@ -2,8 +2,8 @@ __doc__ = """
>>> f(1.0, 2.95)[0] == f(1.0, 2.95)[1]
True
>>> constant_py()
1024L
>>> constant_py() == 2L ** 10
True
>>> constant_long() == 2L ** 36
True
......
__doc__ = """
>>> f()
"""
cdef struct Spam:
char *grail
cdef void f():
def f():
cdef int i, j, k
cdef char *p
i = sizeof(p)
......
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