Commit c8665b07 authored by Robert Bradshaw's avatar Robert Bradshaw

Add tags to test files.

parent c56ebd92
# mode: compile
cdef public struct Foo: cdef public struct Foo:
int a, b int a, b
......
# mode: compile
cdef swallow cdef swallow
def spam(w, int x = 42, y = "grail", z = swallow): def spam(w, int x = 42, y = "grail", z = swallow):
......
# mode: compile
cdef extern from *: cdef extern from *:
......
# mode: compile
cdef enum E: cdef enum E:
z z
......
# mode: compile
cdef void f1(char *argv[]): cdef void f1(char *argv[]):
f2(argv) f2(argv)
......
# mode: compile
cdef void spam(): cdef void spam():
cdef long long L cdef long long L
cdef unsigned long long U cdef unsigned long long U
......
# mode: compile
def f(a, b): def f(a, b):
assert a, a+b assert a, a+b
# mode: compile
cdef enum E: cdef enum E:
spam, eggs spam, eggs
......
# mode: compile
cdef extern from *: cdef extern from *:
ctypedef int intptr_t ctypedef int intptr_t
......
# ticket: 444
# mode: compile
def test(): def test():
cdef object[int] not_assigned_to cdef object[int] not_assigned_to
......
# mode: compile
def f(): def f():
x = open("foo") x = open("foo")
# mode: compile
cdef int f() except -1: cdef int f() except -1:
cdef object x, y, z, w cdef object x, y, z, w
cdef int i cdef int i
......
# mode: compile
# cython: boundscheck = False # cython: boundscheck = False
# cython: ignoreme = OK # cython: ignoreme = OK
# cython: warn.undeclared = False # cython: warn.undeclared = False
......
# mode: compile
cdef extern from "callingconvention.h": cdef extern from "callingconvention.h":
pass pass
......
# mode: compile
def f(obj, int i, float f, char *s1, char s2[]): def f(obj, int i, float f, char *s1, char s2[]):
pass pass
......
# mode: compile
cdef extern: cdef extern:
cdef func(int[]) cdef func(int[])
# mode: compile
cdef void foo(): cdef void foo():
cdef int bool, int1=0, int2=0, int3=0, int4=0 cdef int bool, int1=0, int2=0, int3=0, int4=0
cdef object obj1, obj2, obj3, obj4 cdef object obj1, obj2, obj3, obj4
......
# mode: compile
cdef void foo(): cdef void foo():
cdef int i1, i2=0 cdef int i1, i2=0
cdef char c1=0, c2 cdef char c1=0, c2
......
# ticket: 518
# mode: compile
cdef extern from "cast_ctypedef_array_T518_helper.h": cdef extern from "cast_ctypedef_array_T518_helper.h":
cdef struct __foo_struct: cdef struct __foo_struct:
int i, j int i, j
......
# mode: compile
cdef extern class external.Spam: cdef extern class external.Spam:
pass pass
......
# mode: compile
cdef extern from "cheese.h": cdef extern from "cheese.h":
pass pass
# mode: compile
cdef extern from *: cdef extern from *:
int spam int spam
# mode: compile
cdef enum Spam: cdef enum Spam:
a a
b, c, b, c,
......
# mode: compile
cdef int i, j, k cdef int i, j, k
cdef object a, b, x cdef object a, b, x
......
# ticket: 4
# mode: compile
from a cimport b from a cimport b
cdef int **t = b.foo(NULL) cdef int **t = b.foo(NULL)
# ticket: 248
# mode: compile
from ewing8 cimport (Foo, from ewing8 cimport (Foo,
......
# mode: compile
__doc__ = u""" __doc__ = u"""
>>> s = Swallow() >>> s = Swallow()
>>> s.spam(1) >>> s.spam(1)
......
# mode: compile
cdef extern from "cnamespec.h": cdef extern from "cnamespec.h":
int a "c_a", b "c_b" int a "c_a", b "c_b"
......
# mode: compile
def f(): def f():
cdef int int1, int2=0, int3=1 cdef int int1, int2=0, int3=1
cdef char char1=0 cdef char char1=0
......
# mode: compile
cdef void f(): cdef void f():
cdef void *p cdef void *p
cdef char *q=NULL cdef char *q=NULL
......
# mode: compile
cdef extern (int *[42]) spam, grail, swallow cdef extern (int *[42]) spam, grail, swallow
cdef (int (*)()) brian(): cdef (int (*)()) brian():
......
# mode: compile
cdef enum Grail: cdef enum Grail:
k = 42 k = 42
......
# mode: compile
cdef class Tst: cdef class Tst:
cdef foo, cdef foo,
# mode: compile
cdef class A: cdef class A:
cpdef a(self): cpdef a(self):
ma(self) ma(self)
......
# tag: cpp
# mode: compile
cdef extern from "cpp_enums.h": cdef extern from "cpp_enums.h":
cdef enum Enum1: cdef enum Enum1:
Item1 Item1
......
# tag: cpp
# mode: compile
cdef extern from "operators.h": cdef extern from "operators.h":
cdef cppclass Operators: cdef cppclass Operators:
Operators(int) Operators(int)
......
# tag: cpp
# mode: compile
cdef extern from "point.h" namespace "geometry": cdef extern from "point.h" namespace "geometry":
cdef struct Point: cdef struct Point:
......
# tag: cpp
# mode: compile
cdef extern from *: cdef extern from *:
cdef cppclass Foo[T]: cdef cppclass Foo[T]:
pass pass
......
# tag: cpp
# mode: compile
cdef extern from "templates.h": cdef extern from "templates.h":
cdef cppclass TemplateTest1[T]: cdef cppclass TemplateTest1[T]:
TemplateTest1() TemplateTest1()
......
# mode: compile
ctypedef struct Foo: ctypedef struct Foo:
int blarg int blarg
......
# mode: compile
ctypedef int *IntPtr ctypedef int *IntPtr
ctypedef unsigned long ULong ctypedef unsigned long ULong
cdef extern IntPtr spam cdef extern IntPtr spam
......
# ticket: 355
# mode: compile
ctypedef public class Time [type MyTime_Type, object MyTimeObject]: ctypedef public class Time [type MyTime_Type, object MyTimeObject]:
def __init__(self, seconds): def __init__(self, seconds):
self.seconds = seconds self.seconds = seconds
......
# mode: compile
ctypedef class spam: ctypedef class spam:
pass pass
......
# mode: compile
ctypedef enum parrot_state: ctypedef enum parrot_state:
alive = 1 alive = 1
dead = 2 dead = 2
......
# mode: compile
ctypedef public api class Foo [type PyFoo_Type, object PyFooObject]: ctypedef public api class Foo [type PyFoo_Type, object PyFooObject]:
pass pass
......
# mode: compile
ctypedef struct order: ctypedef struct order:
int spam int spam
int eggs int eggs
......
# mode: compile
ctypedef union pet: ctypedef union pet:
int cat int cat
float dog float dog
......
# mode: compile
cdef void f(): cdef void f():
cdef unsigned long x cdef unsigned long x
cdef object y=0 cdef object y=0
......
# mode: compile
cdef extern short int s cdef extern short int s
cdef extern long int l cdef extern long int l
cdef extern long long ll cdef extern long long ll
......
# mode: compile
cdef class Tomato: cdef class Tomato:
def eject(self): def eject(self):
......
# mode: compile
cdef extern from "declarations.h": cdef extern from "declarations.h":
pass pass
......
# mode: compile
def f(a, b): def f(a, b):
global g global g
del g del g
......
# mode: compile
cdef void spam(): cdef void spam():
cdef object x cdef object x
del x[17:42] del x[17:42]
......
# mode: compile
"Welcome to the parrot module. It is currently resting." "Welcome to the parrot module. It is currently resting."
def zap(polly, volts): def zap(polly, volts):
......
# mode: compile
cdef class Spam: cdef class Spam:
pass pass
......
# mode: compile
cimport dotted_cimport_submodule.a cimport dotted_cimport_submodule.a
import dotted_cimport_submodule.b import dotted_cimport_submodule.b
# mode: compile
cdef char *s cdef char *s
s = r'\"HT\"' s = r'\"HT\"'
# ticket: 488
# mode: compile
#from ... import foo #from ... import foo
print ... print ...
......
# mode: compile
cdef void f(): cdef void f():
try: try:
pass pass
......
# mode: compile
cdef enum E: cdef enum E:
a a
......
# mode: compile
cdef void foo(): cdef void foo():
cdef int bool, int1=0, int2=0 cdef int bool, int1=0, int2=0
cdef float float1=0, float2=0 cdef float float1=0, float2=0
......
# mode: compile
cdef int blarg(int i): cdef int blarg(int i):
pass pass
......
# mode: compile
cdef class C: cdef class C:
cdef f(self): cdef f(self):
pass pass
# mode: compile
cdef void f(): cdef void f():
"This is a pseudo doc string." "This is a pseudo doc string."
......
# mode: compile
cdef char *f(): cdef char *f():
raise Exception raise Exception
......
# mode: compile
# Spurious gcc3.3 warnings about incompatible pointer # Spurious gcc3.3 warnings about incompatible pointer
# types passed to C method # types passed to C method
......
# mode: compile
cdef class A: cdef class A:
cdef void f(self, x): cdef void f(self, x):
pass pass
......
# mode: compile
cdef class Blarg: cdef class Blarg:
pass pass
# mode: compile
cdef struct xmlDoc: cdef struct xmlDoc:
int i int i
# mode: compile
cdef extern from "excvalcheck.h": cdef extern from "excvalcheck.h":
pass pass
......
# mode: compile
cdef int spam() except 42: cdef int spam() except 42:
pass pass
......
# mode: compile
cdef int spam() except -1: cdef int spam() except -1:
eggs = 42 eggs = 42
......
# mode: compile
cdef extern class somewhere.Swallow: cdef extern class somewhere.Swallow:
pass pass
......
# mode: compile
cdef class Spam: cdef class Spam:
cdef int tons cdef int tons
......
# mode: compile
cdef class Grail: cdef class Grail:
def __add__(int x, float y): def __add__(int x, float y):
......
# mode: compile
cdef class Spam: cdef class Spam:
def __delattr__(self, n): def __delattr__(self, n):
......
# mode: compile
cdef class Spam: cdef class Spam:
def __delitem__(self, i): def __delitem__(self, i):
......
# mode: compile
cdef class Spam: cdef class Spam:
def __delslice__(self, Py_ssize_t i, Py_ssize_t j): def __delslice__(self, Py_ssize_t i, Py_ssize_t j):
......
# mode: compile
cdef class Foo: cdef class Foo:
def __delete__(self, i): def __delete__(self, i):
......
# mode: compile
cdef class Foo: cdef class Foo:
def __get__(self, i, c): def __get__(self, i, c):
......
# mode: compile
cdef class Foo: cdef class Foo:
def __set__(self, i, v): def __set__(self, i, v):
......
# mode: compile
cdef extern int i cdef extern int i
cdef extern char *s[] cdef extern char *s[]
cdef extern void spam(char c) cdef extern void spam(char c)
......
# mode: compile
cdef extern class external.Spam [object SpamObject]: cdef extern class external.Spam [object SpamObject]:
pass pass
......
# mode: compile
cdef class Spam cdef class Spam
cdef class Grail: cdef class Grail:
......
# mode: compile
cdef class Spam: cdef class Spam:
def __getattr__(self, x): def __getattr__(self, x):
......
# mode: compile
cdef class Spam: cdef class Spam:
def __getitem__(self, x): def __getitem__(self, x):
......
# mode: compile
cdef class Spam: cdef class Spam:
def __hash__(self): def __hash__(self):
......
# mode: compile
cdef extern class Spam.Eggs.Ham: cdef extern class Spam.Eggs.Ham:
pass pass
......
# mode: compile
from crunchytype cimport Crunchy from crunchytype cimport Crunchy
cdef class Sub2(Crunchy): cdef class Sub2(Crunchy):
......
# mode: compile
cdef class Spam: cdef class Spam:
def __index__(self): def __index__(self):
......
# mode: compile
cdef class Parrot: cdef class Parrot:
pass pass
......
# mode: compile
cdef class Parrot: cdef class Parrot:
pass pass
......
# mode: compile
cdef class Spam: cdef class Spam:
property eggs: property eggs:
......
# mode: compile
cdef class Spam: cdef class Spam:
property eggs: property eggs:
......
# mode: compile
cdef class Spam: cdef class Spam:
property eggs: property eggs:
......
# mode: compile
cdef class Spam: cdef class Spam:
property eggs: property eggs:
......
# mode: compile
cdef class Spam: cdef class Spam:
property eggs: property eggs:
......
# mode: compile
cdef class Spam: cdef class Spam:
cdef public char c cdef public char c
cdef public int i cdef public int i
......
# mode: compile
cdef class Spam: cdef class Spam:
def __setattr__(self, n, x): def __setattr__(self, n, x):
......
# mode: compile
cdef class Spam: cdef class Spam:
def __setitem__(self, i, x): def __setitem__(self, i, x):
......
# mode: compile
cdef class Spam: cdef class Spam:
def __setslice__(self, Py_ssize_t i, Py_ssize_t j, x): def __setslice__(self, Py_ssize_t i, Py_ssize_t j, x):
......
# mode: compile
cimport cython cimport cython
......
# mode: compile
def f(a, b, c): def f(a, b, c):
cdef int i cdef int i
for a in b: for a in b:
......
# mode: compile
cdef void spam(): cdef void spam():
cdef int i, j=0, k=0 cdef int i, j=0, k=0
for i from 0 <= i < 10: for i from 0 <= i < 10:
......
# mode: compile
cdef int x cdef int x
x = 42 x = 42
......
# mode: compile
def f(): def f():
from spam import eggs from spam import eggs
from spam.morespam import bacon, eggs, ham from spam.morespam import bacon, eggs, ham
......
# mode: compile
cdef int grail(): cdef int grail():
cdef int (*spam)() cdef int (*spam)()
spam = &grail spam = &grail
......
# mode: compile
def f(x, y): def f(x, y):
x = y x = y
......
# mode: compile
global __name__ global __name__
print __name__ print __name__
# mode: compile
def f(): def f():
global a,b,c,d global a,b,c,d
a = b a = b
......
# mode: compile
cdef int a_global_int cdef int a_global_int
cdef a_global_pyobject cdef a_global_pyobject
......
# mode: compile
ctypedef enum someenum_t: ctypedef enum someenum_t:
ENUMVALUE_1 ENUMVALUE_1
ENUMVALUE_2 ENUMVALUE_2
......
# mode: compile
cdef class vector: cdef class vector:
def __div__(vector self, double factor): def __div__(vector self, double factor):
cdef object result = vector() cdef object result = vector()
......
# mode: compile
cdef enum Color: cdef enum Color:
red red
white white
......
# mode: compile
cdef: cdef:
struct PrivFoo: struct PrivFoo:
......
# mode: compile
def f(): def f():
import spam import spam
import spam.eggs import spam.eggs
......
# mode: compile
def f(obj1, obj2, obj3): def f(obj1, obj2, obj3):
cdef int int1, int2=0, int3=0 cdef int int1, int2=0, int3=0
cdef float flt1, *ptr1=NULL cdef float flt1, *ptr1=NULL
......
# mode: compile
cdef int* a cdef int* a
cdef object x cdef object x
......
# mode: compile
cdef class A: cdef class A:
def __getitem__(self, x): def __getitem__(self, x):
......
# mode: compile
cdef void __stdcall f(): cdef void __stdcall f():
pass pass
......
# mode: compile
cdef class Position cdef class Position
cdef class Point(Position) cdef class Point(Position)
cdef class Vector(Point) cdef class Vector(Point)
......
# mode: compile
cdef class A: cdef class A:
cdef object x cdef object x
# mode: compile
def f(): def f():
cdef int i=0 cdef int i=0
global mylist global mylist
......
# mode: compile
cdef extern from "string.h": cdef extern from "string.h":
void memcpy(void* des, void* src, int size) void memcpy(void* des, void* src, int size)
......
# mode: compile
ctypedef enum foo: ctypedef enum foo:
FOO FOO
......
# mode: compile
cdef class C: cdef class C:
cdef object foo cdef object foo
......
# mode: compile
cdef class T: cdef class T:
cdef int a[1] cdef int a[1]
......
# mode: compile
def f(x,): def f(x,):
pass pass
......
# mode: compile
ctypedef struct BB: ctypedef struct BB:
void (*f) (void* state) void (*f) (void* state)
# mode: compile
cimport libc cimport libc
cimport libc.stdio cimport libc.stdio
......
# mode: compile
from libc.errno cimport * from libc.errno cimport *
if errno == EDOM : pass if errno == EDOM : pass
......
# mode: compile
from libc.math cimport (M_E, M_LOG2E, M_LOG10E, M_LN2, M_LN10, M_PI, M_PI_2, from libc.math cimport (M_E, M_LOG2E, M_LOG10E, M_LN2, M_LN10, M_PI, M_PI_2,
M_PI_4, M_1_PI, M_2_PI, M_2_SQRTPI, M_SQRT2, M_SQRT1_2) M_PI_4, M_1_PI, M_2_PI, M_2_SQRTPI, M_SQRT2, M_SQRT1_2)
from libc.math cimport (acos, asin, atan, atan2, cos, sin, tan, cosh, sinh, from libc.math cimport (acos, asin, atan, atan2, cos, sin, tan, cosh, sinh,
......
# mode: compile
from libc.signal cimport * from libc.signal cimport *
cdef void sighdl(int signum) nogil: cdef void sighdl(int signum) nogil:
......
# mode: compile
cdef extern unsigned long x cdef extern unsigned long x
cdef extern long unsigned y cdef extern long unsigned y
# mode: compile
cdef void foo(): cdef void foo():
cdef int bool, int1=0, int2=0 cdef int bool, int1=0, int2=0
bool = int1 < int2 bool = int1 < int2
......
# mode: compile
"""A long module docstring. """A long module docstring.
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer sit amet Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer sit amet
......
# mode: compile
cdef extern object g(object x) nogil cdef extern object g(object x) nogil
cdef extern void g2(object x) nogil cdef extern void g2(object x) nogil
......
# mode: compile
cdef class spam: cdef class spam:
pass pass
......
# mode: compile
cdef void spam(): cdef void spam():
eggs = None eggs = None
......
# mode: compile
cdef extern class external.Spam [object Spam]: pass cdef extern class external.Spam [object Spam]: pass
cdef extern class external.Eggs [object Eggs]: pass cdef extern class external.Eggs [object Eggs]: pass
......
# mode: compile
cdef char *p1 cdef char *p1
cdef int *p2 cdef int *p2
cdef int x cdef int x
......
# mode: compile
cdef extern void spam(int, char *) cdef extern void spam(int, char *)
# mode: compile
__doc__ = u""" __doc__ = u"""
>>> fiches_CP >>> fiches_CP
[] []
......
# mode: compile
cimport posix cimport posix
cimport posix.unistd cimport posix.unistd
......
# mode: compile
# -- # --
ctypedef int Int0 ctypedef int Int0
......
# mode: compile
# -- # --
ctypedef int Int0 ctypedef int Int0
......
# mode: compile
# -- # --
ctypedef int Int0 ctypedef int Int0
......
# mode: compile
cdef class Foo1: pass cdef class Foo1: pass
cdef class Foo2: pass cdef class Foo2: pass
cdef class Foo3: pass cdef class Foo3: pass
......
# mode: compile
class A: class A:
def foo(self): def foo(self):
return "A" return "A"
......
# mode: compile
class Spam: class Spam:
def eggs(self): def eggs(self):
......
# mode: compile
cdef extern from "Python.h": cdef extern from "Python.h":
ctypedef struct PyTypeObject: ctypedef struct PyTypeObject:
pass pass
......
# mode: compile
__doc__ = u""" __doc__ = u"""
>>> main() >>> main()
3.14159265358979323846 3.14159265358979323846
......
# mode: compile
cdef struct S: cdef struct S:
char c char c
unsigned char uc unsigned char uc
......
# mode: compile
def f(a, b, c, d, e, f, g, h, i): def f(a, b, c, d, e, f, g, h, i):
a = b[c:d, e:f:g, ..., h, :i:] a = b[c:d, e:f:g, ..., h, :i:]
# mode: compile
DEF nan = float('nan') DEF nan = float('nan')
DEF inf = float('inf') DEF inf = float('inf')
DEF minf = -float('inf') DEF minf = -float('inf')
......
# mode: compile
cdef class Grail: cdef class Grail:
def __cinit__(self, spam = None): def __cinit__(self, spam = None):
......
# mode: compile
cdef class C: cdef class C:
def __cinit__(self): def __cinit__(self):
"This is an unusable docstring." "This is an unusable docstring."
......
# mode: compile
cdef class Spam: cdef class Spam:
cdef int eggs cdef int eggs
......
# mode: compile
def spam(): def spam():
raise Exception raise Exception
......
# mode: compile
def f(a, b, c, x): def f(a, b, c, x):
cdef int i cdef int i
a = b + c a = b + c
......
# mode: compile
def f(a, b, c, x): def f(a, b, c, x):
cdef int i cdef int i
a = b + c a = b + c
......
# mode: compile
cdef void f(obj): cdef void f(obj):
cdef size_t i=0 cdef size_t i=0
cdef char *p cdef char *p
......
# mode: compile
print sizeof(point*) print sizeof(point*)
cdef foo(int i0, int i, list L0, list L, point p0, point p, point* ps): cdef foo(int i0, int i, list L0, list L, point p0, point p, point* ps):
......
# mode: compile
cdef int x cdef int x
x = 0xFFFFFFFF x = 0xFFFFFFFF
# ticket: 276
# mode: compile
__doc__ = u""" __doc__ = u"""
""" """
......
# mode: compile
def f(a, b): def f(a, b):
cdef int i = 5 cdef int i = 5
......
# mode: compile
cdef void f() with gil: cdef void f() with gil:
x = 42 x = 42
......
# ticket: 117
# mode: error
ctypedef object[float] mybuffer ctypedef object[float] mybuffer
_ERRORS = u""" _ERRORS = u"""
......
# mode: error
# current restriction: cannot inherit from PyVarObject (see ticket #152) # current restriction: cannot inherit from PyVarObject (see ticket #152)
......
# mode: error
def f(*args, **kwargs): def f(*args, **kwargs):
pass pass
......
# ticket: 307
# mode: error
nonexisting(3, with_kw_arg=4) nonexisting(3, with_kw_arg=4)
_ERRORS = u""" _ERRORS = u"""
......
# ticket: 517
# mode: error
ctypedef void* VoidP ctypedef void* VoidP
cdef class Spam: cdef class Spam:
......
# mode: error
cdef pass cdef pass
cdef void cdef void
......
# mode: error
__doc__ = u""" __doc__ = u"""
>>> call2() >>> call2()
>>> call3() >>> call3()
......
# mode: error
def call5(): def call5():
b(1,2,3,4,5) b(1,2,3,4,5)
......
# mode: error
cdef class Test: cdef class Test:
cdef __cinit__(self): cdef __cinit__(self):
......
# mode: error
cdef class C: cdef class C:
cdef void f(self): cdef void f(self):
pass pass
......
# ticket: 370
# mode: error
cdef int raiseit(): cdef int raiseit():
raise IndexError raise IndexError
......
# mode: error
cpdef nogil: pass cpdef nogil: pass
cpdef nogil class test: pass cpdef nogil class test: pass
......
# tag: cpp
# mode: error
cdef extern from *: cdef extern from *:
cdef cppclass Foo: cdef cppclass Foo:
Foo() Foo()
......
# mode: error
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# cython: language_level=3 # cython: language_level=3
......
# ticket: 158
# mode: error
def mult_decl_test(): def mult_decl_test():
print "%s" % vv print "%s" % vv
print "%s" % s print "%s" % s
......
# mode: error
def test() nogil: def test() nogil:
pass pass
......
# ticket: 290
# mode: error
cdef packed foo: cdef packed foo:
pass pass
......
# mode: error
def f(): def f():
cdef int int1, int3 cdef int int1, int3
cdef int *ptr1, *ptr2, *ptr3 cdef int *ptr1, *ptr2, *ptr3
......
# mode: error
cdef spam(int i, char *s = "blarg", float f): # can't have default value cdef spam(int i, char *s = "blarg", float f): # can't have default value
pass pass
......
# mode: error
cdef void foo(obj): cdef void foo(obj):
cdef int i1 cdef int i1
cdef char *p1 cdef char *p1
......
# mode: error
cdef void spam(): cdef void spam():
None = 42 None = 42
_ERRORS = u""" _ERRORS = u"""
......
# mode: error
cimport cython cimport cython
@cython.autotestdict(False) @cython.autotestdict(False)
......
# mode: error
cdef char *spam() except -1: cdef char *spam() except -1:
pass pass
......
# mode: error
cdef struct Spam cdef struct Spam
cdef extern int spam(void) # function argument cannot be void cdef extern int spam(void) # function argument cannot be void
......
# mode: error
cdef struct Foo cdef struct Foo
def f(Foo *p): def f(Foo *p):
......
# mode: error
cdef struct Grail cdef struct Grail
cdef extern object xobj # Python object cannot be extern cdef extern object xobj # Python object cannot be extern
......
# mode: error
def f(): def f():
cdef int int1, int2 cdef int int1, int2
cdef char *ptr cdef char *ptr
......
# mode: error
ctypedef struct struct_type_not_boolean: ctypedef struct struct_type_not_boolean:
int i int i
float f float f
......
# mode: error
cdef object[int] buf cdef object[int] buf
cdef class A: cdef class A:
cdef object[int] buf cdef object[int] buf
......
# mode: error
cimport e_bufaccess_pxd # was needed to provoke a bug involving ErrorType cimport e_bufaccess_pxd # was needed to provoke a bug involving ErrorType
import cython import cython
......
# mode: error
cdef int i cdef int i
i() i()
......
# mode: error
cimport cython cimport cython
@cython.callspec("") @cython.callspec("")
......
# ticket: 241
# mode: error
cdef some_function(x, y): cdef some_function(x, y):
pass pass
......
# mode: error
cdef int cdef int
cdef extern from *: cdef extern from *:
......
# mode: error
cdef class A: cdef class A:
cdef int value = 3 cdef int value = 3
......
# mode: error
cdef struct spam: cdef struct spam:
pass pass
......
# mode: error
cdef enum Spam: cdef enum Spam:
a, b, c a, b, c
......
# mode: error
cdef class C: cdef class C:
cdef void f(self): cdef void f(self):
pass pass
......
# mode: error
cdef void foo(): cdef void foo():
cdef int bool, int1 cdef int bool, int1
cdef char *ptr2 cdef char *ptr2
......
# mode: error
cdef struct Spam: cdef struct Spam:
int i int i
char c char c
......
# mode: error
ctypedef struct Spam ctypedef struct Spam
cdef extern from *: cdef extern from *:
......
# mode: error
cdef struct Foo cdef struct Foo
ctypedef struct Foo: ctypedef struct Foo:
......
# mode: error
cdef extern void fa[5]() cdef extern void fa[5]()
cdef extern int af()[5] cdef extern int af()[5]
cdef extern int ff()() cdef extern int ff()()
......
# mode: error
_ERRORS = u""" _ERRORS = u"""
4:4 Expected a newline after decorator 4:4 Expected a newline after decorator
......
# mode: error
cdef struct S: cdef struct S:
int m int m
......
# mode: error
# cython: nonexistant = True # cython: nonexistant = True
# cython: boundscheck = true # cython: boundscheck = true
......
# mode: error
try: try:
raise KeyError raise KeyError
......
# mode: error
ctypedef int (*spamfunc)(int, char *) except 42 ctypedef int (*spamfunc)(int, char *) except 42
ctypedef int (*grailfunc)(int, char *) ctypedef int (*grailfunc)(int, char *)
......
# mode: error
cdef class C: cdef class C:
cdef object __weakref__ cdef object __weakref__
......
# mode: error
cimport e_func_in_pxd_support cimport e_func_in_pxd_support
_ERRORS = u""" _ERRORS = u"""
......
# mode: error
def f(obj1, obj2): def f(obj1, obj2):
cdef int int1, int2, int3 cdef int int1, int2, int3
cdef float flt1, *ptr1 cdef float flt1, *ptr1
......
# mode: error
# cython: language_level=2 # cython: language_level=2
def int_literals(): def int_literals():
......
# mode: error
# cython: language_level=3 # cython: language_level=3
def int_literals(): def int_literals():
......
# mode: error
def f(obj1a, obj1b): def f(obj1a, obj1b):
cdef int int1, int2, int3 cdef int int1, int2, int3
cdef int *ptr2 cdef int *ptr2
......
# mode: error
cdef extern grail(char *s, int i) cdef extern grail(char *s, int i)
cdef extern spam(char *s, int i,...) cdef extern spam(char *s, int i,...)
......
# mode: error
cdef class C: cdef class C:
cdef void f(self) nogil: cdef void f(self) nogil:
pass pass
......
# mode: error
cdef extern from *: cdef extern from *:
cdef void f() cdef void f()
cdef void (*fp)() nogil cdef void (*fp)() nogil
......
# mode: error
cdef signed float e cdef signed float e
cdef unsigned float f cdef unsigned float f
cdef signed double g cdef signed double g
......
# mode: error
cdef extern class Grail.Shrubbery cdef extern class Grail.Shrubbery
cdef void spam(Shrubbery sh not None): cdef void spam(Shrubbery sh not None):
......
# mode: error
def eggs(int x not None, char* y not None): def eggs(int x not None, char* y not None):
pass pass
_ERRORS = u""" _ERRORS = u"""
......
# mode: error
def f(): def f():
cdef int int1, int2 cdef int int1, int2
cdef int *ptr cdef int *ptr
......
# ticket: 290
# mode: error
cdef extern: cdef extern:
cdef packed struct MyStruct: cdef packed struct MyStruct:
char a char a
......
# mode: error
def f(): def f():
cdef char *str1 cdef char *str1
cdef float flt1, flt2, flt3 cdef float flt1, flt2, flt3
......
# mode: error
cimport e_pxdimpl_imported cimport e_pxdimpl_imported
_ERRORS = u""" _ERRORS = u"""
......
# mode: error
cdef object x cdef object x
cdef struct spam: cdef struct spam:
......
# mode: error
cdef void g(): cdef void g():
cdef int i cdef int i
return i # error return i # error
......
# mode: error
cdef struct unbekannt cdef struct unbekannt
cdef int n cdef int n
n = sizeof(unbekannt) n = sizeof(unbekannt)
......
# mode: error
def f(obj2): def f(obj2):
cdef int *ptr1 cdef int *ptr1
obj1 = obj2[ptr1::] # error obj1 = obj2[ptr1::] # error
......
# mode: error
cdef int c1 = "t" # works cdef int c1 = "t" # works
cdef int c2 = "te" # fails cdef int c2 = "te" # fails
cdef int cx = "test" # fails cdef int cx = "test" # fails
......
# mode: error
def f(): def f():
cdef int int2 cdef int int2
cdef char *ptr1, *ptr2, *ptr3 cdef char *ptr1, *ptr2, *ptr3
......
# mode: error
cdef int x = 3 cdef int x = 3
if x == NONEXISTING: if x == NONEXISTING:
......
# mode: error
cdef object blarg cdef object blarg
def foo(obj): def foo(obj):
......
# mode: error
cdef class Spam cdef class Spam
cdef extern class external.Eggs cdef extern class external.Eggs
_ERRORS = u""" _ERRORS = u"""
......
# mode: error
def f(): def f():
cdef int int1 cdef int int1
cdef char *str2 cdef char *str2
......
# mode: error
def f(a, b): def f(a, b):
cdef int i cdef int i
break # error break # error
......
# mode: error
# coding=ASCII # coding=ASCII
""" """
......
# mode: error
__doc__ = u""" __doc__ = u"""
>>> e = ExtClass() >>> e = ExtClass()
>>> e.get() >>> e.get()
......
# mode: error
# invalid syntax (not handled by the parser) # invalid syntax (not handled by the parser)
......
# mode: error
# wrong size RHS (as handled by the parser) # wrong size RHS (as handled by the parser)
......
# mode: error
# invalid syntax (as handled by the parser) # invalid syntax (as handled by the parser)
......
# mode: error
from __future__ import braces from __future__ import braces
_ERRORS = u""" _ERRORS = u"""
......
# mode: error
def f(): def f():
a = <foao>True a = <foao>True
......
# mode: error
u'\uXYZ' u'\uXYZ'
......
# mode: error
def f(): def f():
cdef int* p cdef int* p
if false(): if false():
......
# ticket: 262
# mode: error
cdef class Album cdef class Album
cdef class SessionStruct: cdef class SessionStruct:
......
# ticket: 156
# mode: error
cdef class B: cdef class B:
cpdef b(): cpdef b():
......
# ticket: 165
# mode: error
cdef class A: cdef class A:
cpdef a(int not_self): cpdef a(int not_self):
......
# mode: error
cdef object f(object x) nogil: cdef object f(object x) nogil:
pass pass
......
# mode: error
cdef class C: cdef class C:
cdef void f(self): cdef void f(self):
pass pass
......
# mode: error
cdef extern from *: cdef extern from *:
cdef void f() cdef void f()
cdef void (*fp)() nogil cdef void (*fp)() nogil
......
# mode: error
import os import os
DEF ospath = os.path DEF ospath = os.path
......
# ticket: 418
# mode: error
import somemod.child import somemod.child
cdef somemod.child.something x cdef somemod.child.something x
......
# ticket: 286
# mode: error
cdef class A: cdef class A:
pass pass
......
# mode: error
# -*- coding: iso-8859-1 -*- # -*- coding: iso-8859-1 -*-
cdef Py_UCS4 char_ASCII = u'A' cdef Py_UCS4 char_ASCII = u'A'
......
# mode: error
# -*- coding: iso-8859-1 -*- # -*- coding: iso-8859-1 -*-
cdef Py_UNICODE char_ASCII = u'A' cdef Py_UNICODE char_ASCII = u'A'
......
# ticket: 313
# mode: error
a = 3 a = 3
......
# ticket: 135
# mode: error
def _runtime_True(): def _runtime_True():
return True return True
......
# mode: error
def f(): def f():
a = b # space space a = b # space space
c = d # space tab c = d # space tab
......
# mode: error
def f(): def f():
a = b a = b
c = d c = d
......
# mode: error
def f(): def f():
a = b # space space a = b # space space
c = d # tab c = d # tab
......
# mode: error
def f(obj1a, obj2a, obj3a, obj1b, obj2b, obj3b, obj4b): def f(obj1a, obj2a, obj3a, obj1b, obj2b, obj3b, obj4b):
obj1a, (obj2a, obj3a) = obj1b, (obj2b, obj3b, obj4b) obj1a, (obj2a, obj3a) = obj1b, (obj2b, obj3b, obj4b)
......
# mode: error
# coding: ASCII # coding: ASCII
# ok: # ok:
......
# mode: error
cimport cython cimport cython
......
# mode: error
cimport cython cimport cython
......
# ticket: 304
# mode: error
def f(): def f():
print assert sizeof(int) == sizof(short) == sizeof(long) print assert sizeof(int) == sizof(short) == sizeof(long)
......
# mode: error
i = _this_global_name_does_not_exist_ i = _this_global_name_does_not_exist_
def test(i): def test(i):
......
# mode: error
cdef extern from *: cdef extern from *:
void foo(void) void foo(void)
......
# ticket: 295
cimport cython cimport cython
......
# ticket: 658
def outer(int x, *args, **kwargs): def outer(int x, *args, **kwargs):
""" """
......
#cython: autotestdict=True #cython: autotestdict=True
""" """
Tests that autotestdict doesn't come into effect when Tests that autotestdict doesn't come into effect when
a __test__ is defined manually. a __test__ is defined manually.
......
# ticket: 252
cdef cf(default=None): cdef cf(default=None):
return default return default
......
# ticket: 145
cimport cython cimport cython
......
# ticket: 354
cdef class Test: cdef class Test:
""" """
......
# ticket: 589
cimport cython cimport cython
......
# tag: py3
__doc__ = u""" __doc__ = u"""
>>> test_xrange() >>> test_xrange()
0 0
......
# ticket: 608
cdef class MyInt(int): cdef class MyInt(int):
""" """
......
# ticket: 166
__doc__ = u""" __doc__ = u"""
>>> l = None >>> l = None
>>> l.append(2) >>> l.append(2)
......
# ticket: 255
__doc__ = u"" __doc__ = u""
# ------------------------------------------------------------------- # -------------------------------------------------------------------
......
# ticket: 236
__doc__ = '' __doc__ = ''
......
# ticket: 467
def simple_parallel_assignment_from_call(): def simple_parallel_assignment_from_call():
""" """
......
# ticket: 466
# extension to T409 # extension to T409
def simple_parallel_typed(): def simple_parallel_typed():
......
# ticket: 227
from cpython.bool cimport bool from cpython.bool cimport bool
def foo(bool a): def foo(bool a):
......
# ticket: 183
cimport cython cimport cython
@cython.cdivision(True) @cython.cdivision(True)
......
# ticket: 477
import cython import cython
@cython.locals(x=double) @cython.locals(x=double)
cdef func(x): cdef func(x):
......
# ticket: 517
#cython: embedsignature=True #cython: embedsignature=True
__doc__ = u""" __doc__ = u"""
>>> a = A() >>> a = A()
>>> a.h = 7 >>> a.h = 7
......
# ticket: 462
cimport cython cimport cython
......
# ticket: 284
def no_cdef(): def no_cdef():
""" """
>>> no_cdef() >>> no_cdef()
......
# ticket: 408
__doc__ = """ __doc__ = """
>>> call_with_tuple(1, 1.2, 'test', [1,2,3]) >>> call_with_tuple(1, 1.2, 'test', [1,2,3])
(1, 1.2, 'test', [1, 2, 3]) (1, 1.2, 'test', [1, 2, 3])
......
# ticket: 99
cdef char c = 'c' cdef char c = 'c'
cdef char* s = 'abcdef' cdef char* s = 'abcdef'
......
# ticket: 412
def f(): def f():
""" """
>>> f() >>> f()
......
# ticket: 582
cimport cython cimport cython
......
# ticket: 505
cimport cython cimport cython
cdef extern from "Python.h": cdef extern from "Python.h":
......
# ticket: 18
__doc__ = u""" __doc__ = u"""
>>> f = PyFoo() >>> f = PyFoo()
>>> print(f.bar) >>> print(f.bar)
......
# ticket: 87
__doc__ = u""" __doc__ = u"""
>>> d = Defined() >>> d = Defined()
......
# ticket: 336
__doc__ = u""" __doc__ = u"""
>>> print('\\n'.join(calls)) >>> print('\\n'.join(calls))
Py-Honk PyTestClass Py-Honk PyTestClass
......
# ticket: 596
def simple(a, b): def simple(a, b):
""" """
>>> kls = simple(1, 2) >>> kls = simple(1, 2)
......
# ticket: 478
__doc__ = """ __doc__ = """
>>> Num(13).is_prime() >>> Num(13).is_prime()
args (Num(13),) kwds {} args (Num(13),) kwds {}
......
# ticket: 554
def call_f(x): def call_f(x):
""" """
>>> call_f(2) >>> call_f(2)
......
# ticket: 537
__doc__ = u""" __doc__ = u"""
>>> f1 = nested1() >>> f1 = nested1()
......
# ticket: 82
cimport cython cimport cython
......
# ticket: 445
def complex_double_cast(double x, double complex z): def complex_double_cast(double x, double complex z):
""" """
>>> complex_double_cast(1, 4-3j) >>> complex_double_cast(1, 4-3j)
......
# ticket: 446
import cython import cython
cdef extern from "complex_int_T446_fix.h": cdef extern from "complex_int_T446_fix.h":
......
# ticket: 305
cimport cython cimport cython
def test_object_conversion(o): def test_object_conversion(o):
......
# ticket: 398
cdef extern from "complex_numbers_c89_T398.h": pass cdef extern from "complex_numbers_c89_T398.h": pass
include "complex_numbers_T305.pyx" include "complex_numbers_T305.pyx"
# ticket: 398
cdef extern from "complex_numbers_c99_T398.h": pass cdef extern from "complex_numbers_c99_T398.h": pass
include "complex_numbers_T305.pyx" include "complex_numbers_T305.pyx"
# ticket: 398
cdef extern from "complex_numbers_cxx_T398.h": pass cdef extern from "complex_numbers_cxx_T398.h": pass
include "complex_numbers_T305.pyx" include "complex_numbers_T305.pyx"
# ticket: 455
def in_sequence(x, seq): def in_sequence(x, seq):
""" """
>>> in_sequence(1, []) >>> in_sequence(1, [])
......
# ticket: 411
cdef class A: cdef class A:
""" """
>>> A().is_True() >>> A().is_True()
......
# tag: cpp
from libcpp cimport bool from libcpp cimport bool
def test_bool(bool a): def test_bool(bool a):
......
# tag: cpp
__doc__ = u""" __doc__ = u"""
>>> test_new_del() >>> test_new_del()
(2, 2) (2, 2)
......
# tag: cpp
cdef int raise_py_error() except *: cdef int raise_py_error() except *:
raise TypeError("custom") raise TypeError("custom")
......
# tag: cpp
cdef int raise_TypeError() except *: cdef int raise_TypeError() except *:
raise TypeError("custom") raise TypeError("custom")
......
# tag: cpp
cdef extern from "cpp_namespaces_helper.h" namespace "A": cdef extern from "cpp_namespaces_helper.h" namespace "A":
ctypedef int A_t ctypedef int A_t
A_t A_func(A_t first, A_t) A_t A_func(A_t first, A_t)
......
# tag: cpp
from cython.operator cimport dereference as deref from cython.operator cimport dereference as deref
cdef extern from "cpp_templates_helper.h": cdef extern from "cpp_templates_helper.h":
......
# tag: cpp
cdef extern from "cpp_nonstdint.h": cdef extern from "cpp_nonstdint.h":
ctypedef int Int24 ctypedef int Int24
ctypedef int Int56 ctypedef int Int56
......
# tag: cpp
cimport cython.operator cimport cython.operator
from cython.operator cimport dereference as deref from cython.operator cimport dereference as deref
......
# tag: cpp
cdef extern from "vector" namespace "std": cdef extern from "vector" namespace "std":
cdef cppclass vector[T]: cdef cppclass vector[T]:
......
# tag: cpp
from cython.operator cimport dereference as d from cython.operator cimport dereference as d
from cython.operator cimport preincrement as incr from cython.operator cimport preincrement as incr
......
# tag: cpp
from cython.operator import dereference as deref from cython.operator import dereference as deref
cdef extern from "cpp_templates_helper.h": cdef extern from "cpp_templates_helper.h":
......
# ticket: 245
cimport crashT245_pxd cimport crashT245_pxd
def f(): def f():
......
# ticket: 333
#cython: autotestdict=True #cython: autotestdict=True
# ------------------------------------------------------------------- # -------------------------------------------------------------------
......
# ticket: 593
""" """
>>> am_i_buggy >>> am_i_buggy
False False
......
# ticket: 384
""" """
>>> test(3) >>> test(3)
(3+1j) (3+1j)
......
# ticket: 488
""" """
>>> test() >>> test()
""" """
......
# ticket: 208
def go_py_empty(): def go_py_empty():
""" """
>>> go_py_empty() >>> go_py_empty()
......
# ticket: 316
cimport cython cimport cython
@cython.test_fail_if_path_exists("//SimpleCallNode//NameNode[@name = 'enumerate']") @cython.test_fail_if_path_exists("//SimpleCallNode//NameNode[@name = 'enumerate']")
......
# ticket: 232
cdef class MyExt: cdef class MyExt:
cdef object attr cdef object attr
......
# ticket: 235
__doc__ = u""" __doc__ = u"""
>>> class FakeSeq(object): >>> class FakeSeq(object):
... def __init__(self, length): ... def __init__(self, length):
......
# ticket: 409
def simple(): def simple():
""" """
>>> simple() >>> simple()
......
# ticket: 258
cdef extern from "Python.h": cdef extern from "Python.h":
ctypedef class __builtin__.list [object PyListObject]: ctypedef class __builtin__.list [object PyListObject]:
......
# ticket: 260
def floor_div_float(double a, double b): def floor_div_float(double a, double b):
""" """
>>> floor_div_float(2, 1.5) >>> floor_div_float(2, 1.5)
......
# ticket: 480
def f(x): def f(x):
return x return x
......
# ticket: 254
def double_target(a, b): def double_target(a, b):
""" """
>>> double_target(0, 4) >>> double_target(0, 4)
......
# ticket: 601
cdef unsigned long size2(): cdef unsigned long size2():
return 3 return 3
......
# ticket: 533
def for_in(): def for_in():
""" """
......
# ticket: 372
cimport cython cimport cython
@cython.test_assert_path_exists("//ForFromStatNode") @cython.test_assert_path_exists("//ForFromStatNode")
......
# ticket: 228
__doc__ = u""" __doc__ = u"""
>>> def py_iterator(): >>> def py_iterator():
... if True: return ... if True: return
......
# ticket: 494
__doc__ = """ __doc__ = """
>>> A.foo = foo >>> A.foo = foo
>>> print A().foo() >>> print A().foo()
......
# ticket: 494
cimport cython cimport cython
class SomeNumber(object): class SomeNumber(object):
......
# ticket: 491
def test_genexpr(): def test_genexpr():
""" """
......
# ticket: 600
cimport cython cimport cython
......
# ticket: 326
__doc__ = u""" __doc__ = u"""
>>> hash(A(5)) >>> hash(A(5))
......
# ticket: 267
""" """
>>> constants(4) >>> constants(4)
1 1
......
# ticket: 544
def count(i=[0]): def count(i=[0]):
i[0] += 1 i[0] += 1
......
# ticket: 400
cimport cython cimport cython
......
# ticket: 431
__doc__ = u""" __doc__ = u"""
>>> s == s_interned >>> s == s_interned
True True
......
# ticket: 562
class IPOW: class IPOW:
""" """
>>> IPOW().__ipow__('a') >>> IPOW().__ipow__('a')
......
# ticket: 195
__doc__ = u""" __doc__ = u"""
#>>> py_identity = lambda x:x #>>> py_identity = lambda x:x
#>>> py_identity(1) == cy_identity(1) #>>> py_identity(1) == cy_identity(1)
......
# ticket: 605
cdef int cdef_CONST = 123 cdef int cdef_CONST = 123
CONST = 456 CONST = 456
......
# ticket: 603
# Module scope lambda functions # Module scope lambda functions
__doc__ = """ __doc__ = """
>>> pow2(16) >>> pow2(16)
256 256
......
# ticket: 237
#def add_large_c(): #def add_large_c():
# cdef unsigned long long val = 2**30 + 2**30 # cdef unsigned long long val = 2**30 + 2**30
# return val # return val
......
# ticket: 598
# cython: language_level=3 # cython: language_level=3
def list_comp_in_closure(): def list_comp_in_closure():
......
# ticket: 430
__doc__ = u""" __doc__ = u"""
>>> sorted( get_locals(1,2,3, k=5) .items()) >>> sorted( get_locals(1,2,3, k=5) .items())
[('args', (2, 3)), ('kwds', {'k': 5}), ('x', 1), ('y', 'hi'), ('z', 5)] [('args', (2, 3)), ('kwds', {'k': 5}), ('x', 1), ('y', 'hi'), ('z', 5)]
......
# ticket: 429
__doc__ = u""" __doc__ = u"""
>>> sorted( get_locals(1,2,3, k=5) .items()) >>> sorted( get_locals(1,2,3, k=5) .items())
[('args', (2, 3)), ('kwds', {'k': 5}), ('x', 1), ('y', 'hi'), ('z', 5)] [('args', (2, 3)), ('kwds', {'k': 5}), ('x', 1), ('y', 'hi'), ('z', 5)]
......
# ticket: 422
""" """
>>> Foo.incr.__module__ is not None >>> Foo.incr.__module__ is not None
True True
......
# ticket: 5
# this is ticket #5 # this is ticket #5
__doc__ = u""" __doc__ = u"""
......
# ticket: 470
__doc__ = u""" __doc__ = u"""
>>> func(**{'a' : 7}) >>> func(**{'a' : 7})
True True
......
# ticket: 172
# tag: numpy
__doc__ = u""" __doc__ = u"""
>>> 1 >>> 1
1 1
......
# ticket: 155
# tag: numpy
""" """
>>> myfunc() >>> myfunc()
0.5 0.5
......
# tag: numpy
""" """
>>> import sys >>> import sys
>>> 'numpy' in sys.modules >>> 'numpy' in sys.modules
......
# tag: numpy
# cannot be named "numpy" in order to not clash with the numpy module! # cannot be named "numpy" in order to not clash with the numpy module!
cimport numpy as np cimport numpy as np
......
# ticket: 290
""" """
>>> f() >>> f()
(9, 9) (9, 9)
......
# ticket: 425
cimport cython cimport cython
@cython.test_assert_path_exists( @cython.test_assert_path_exists(
......
# ticket: 489
""" """
>>> xxx >>> xxx
[0, 1, 2, 3] [0, 1, 2, 3]
......
# ticket: 313
# Ensure casting still works to void* # Ensure casting still works to void*
""" """
......
# ticket: 650
cimport cython cimport cython
......
# ticket: 203
cdef int get_bound(int m): cdef int get_bound(int m):
print u"get_bound(%s)"%m print u"get_bound(%s)"%m
return m return m
......
#!/usr/bin/env python #!/usr/bin/env python
__doc__=u""" __doc__=u"""
>>> t = RefCountInMeth() >>> t = RefCountInMeth()
>>> t.chk_meth() >>> t.chk_meth()
......
# ticket: 404
cdef long foo(long x): cdef long foo(long x):
print "foo(%s)" % x print "foo(%s)" % x
return x return x
......
# ticket: 561
# The patch in #561 changes code generation for most special methods # The patch in #561 changes code generation for most special methods
# to remove the Cython-generated wrapper and let PyType_Ready() # to remove the Cython-generated wrapper and let PyType_Ready()
# generate its own wrapper. (This wrapper would be used, for instance, # generate its own wrapper. (This wrapper would be used, for instance,
......
# ticket: 561
# tag: py2
# This file tests the behavior of special methods under Python 2 # This file tests the behavior of special methods under Python 2
# after #561. (Only methods whose behavior differs between Python 2 and 3 # after #561. (Only methods whose behavior differs between Python 2 and 3
# are tested here; see special_methods_T561.pyx for the rest of the tests.) # are tested here; see special_methods_T561.pyx for the rest of the tests.)
......
# ticket: 561
# tag: py3
# This file tests the behavior of special methods under Python 3 # This file tests the behavior of special methods under Python 3
# after #561. (Only methods whose behavior differs between Python 2 and 3 # after #561. (Only methods whose behavior differs between Python 2 and 3
# are tested here; see special_methods_T561.pyx for the rest of the tests.) # are tested here; see special_methods_T561.pyx for the rest of the tests.)
......
# ticket: 399
__doc__ = u""" __doc__ = u"""
>>> test(-2) >>> test(-2)
-2 -2
......
# ticket: 664
def assign(): def assign():
""" """
>>> assign() >>> assign()
......
# ticket: 412
cdef int i = 'x' cdef int i = 'x'
cdef char c = 'x' cdef char c = 'x'
cdef char* s = 'x' cdef char* s = 'x'
......
# ticket: 409
# Extracted from sage/plot/plot3d/index_face_set.pyx:502 # Extracted from sage/plot/plot3d/index_face_set.pyx:502
# Turns out to be a bug in implementation of PEP 3132 (Extended Iterable Unpacking) # Turns out to be a bug in implementation of PEP 3132 (Extended Iterable Unpacking)
......
# ticket: 654
# function call arguments # function call arguments
......
# ticket: 454
cimport cython cimport cython
......
# ticket: 298
""" """
>>> func() >>> func()
0 0 0 0
......
# ticket: 287
__doc__ = u""" __doc__ = u"""
>>> print( "%d" % Int() ) >>> print( "%d" % Int() )
2 2
......
# ticket: 373
import math import math
cdef class MyClass: cdef class MyClass:
......
# ticket: 303
__doc__ = """ __doc__ = """
>>> readonly() #doctest: +ELLIPSIS >>> readonly() #doctest: +ELLIPSIS
Traceback (most recent call last): Traceback (most recent call last):
......
# ticket: 417
#cython: autotestdict=True #cython: autotestdict=True
cdef class Foo: cdef class Foo:
......
# ticket: 359
__doc__ = u""" __doc__ = u"""
>>> py_string1.decode('ASCII') == 'test toast taste' >>> py_string1.decode('ASCII') == 'test toast taste'
True True
......
# ticket: 184
""" """
>>> c_call() >>> c_call()
(-10, 10) (-10, 10)
......
# ticket: 536
__doc__ = """ __doc__ = """
>>> inner_result >>> inner_result
......
# tag: cpp
cimport cpp_overload_wrapper_lib as cppwrap_lib cimport cpp_overload_wrapper_lib as cppwrap_lib
......
# tag: cpp
cimport cython cimport cython
......
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