From d85651f24ba2f26dc613ff1689258397edc365a7 Mon Sep 17 00:00:00 2001 From: Stefan Behnel Date: Wed, 21 May 2008 19:25:02 +0200 Subject: [PATCH] enabled most remaining tests from the 'broken' directory --HG-- rename : tests/broken/arraytoptrarg.pyx => tests/compile/arraytoptrarg.pyx rename : tests/broken/ass2longlong.pyx => tests/compile/ass2longlong.pyx rename : tests/broken/builtinfuncs.pyx => tests/compile/builtinfuncs.pyx rename : tests/broken/cascmp.pyx => tests/compile/cascmp.pyx rename : tests/broken/cassign.pyx => tests/compile/cassign.pyx rename : tests/broken/casttoexttype.pyx => tests/compile/casttoexttype.pyx rename : tests/broken/cnamespec.pyx => tests/compile/cnamespec.pyx rename : tests/broken/cnumop.pyx => tests/compile/cnumop.pyx rename : tests/broken/cunsignedlong.pyx => tests/compile/cunsignedlong.pyx rename : tests/broken/del.pyx => tests/compile/del.pyx rename : tests/broken/delslice.pyx => tests/compile/delslice.pyx rename : tests/broken/drake1.pyx => tests/compile/drake1.pyx rename : tests/broken/eqcmp.pyx => tests/compile/eqcmp.pyx rename : tests/broken/ewing1.pyx => tests/compile/ewing1.pyx rename : tests/broken/ewing5.pyx => tests/compile/ewing5.pyx rename : tests/broken/excvalcheck.pyx => tests/compile/excvalcheck.pyx rename : tests/broken/excvalreturn.pyx => tests/compile/excvalreturn.pyx rename : tests/broken/extcoerce.pyx => tests/compile/extcoerce.pyx rename : tests/broken/extdescrdel.pyx => tests/compile/extdescrdel.pyx rename : tests/broken/extdescrget.pyx => tests/compile/extdescrget.pyx rename : tests/broken/extdescrset.pyx => tests/compile/extdescrset.pyx rename : tests/broken/extexttype.pyx => tests/compile/extexttype.pyx rename : tests/broken/extgetitem.pyx => tests/compile/extgetitem.pyx rename : tests/broken/extinheritdel.pyx => tests/compile/extinheritdel.pyx rename : tests/broken/extinheritset.pyx => tests/compile/extinheritset.pyx rename : tests/broken/extpropertyall.pyx => tests/compile/extpropertyall.pyx rename : tests/broken/extpymemberdef.pyx => tests/compile/extpymemberdef.pyx rename : tests/broken/forfromelse.pyx => tests/compile/forfromelse.pyx rename : tests/broken/gencall.pyx => tests/compile/gencall.pyx rename : tests/broken/globalstmt.pyx => tests/compile/globalstmt.pyx rename : tests/broken/gustafsson2.pyx => tests/compile/gustafsson2.pyx rename : tests/broken/index.pyx => tests/compile/index.pyx rename : tests/broken/jiba5.pyx => tests/compile/jiba5.pyx rename : tests/broken/jiba6.pyx => tests/compile/jiba6.pyx rename : tests/broken/johnson1.pyx => tests/compile/johnson1.pyx rename : tests/broken/magcmp.pyx => tests/compile/magcmp.pyx rename : tests/broken/none.pyx => tests/compile/none.pyx rename : tests/broken/notnonearg.pyx => tests/compile/notnonearg.pyx rename : tests/broken/r_pernici1.pyx => tests/compile/r_pernici1.pyx rename : tests/broken/slicex.pyx => tests/compile/slicex.pyx rename : tests/broken/traceback.pyx => tests/compile/traceback.pyx rename : tests/broken/watts2.pyx => tests/compile/watts2.pyx rename : tests/broken/anonymousenum.pyx => tests/run/anonymousenum.pyx rename : tests/broken/ass2cglobal.pyx => tests/run/ass2cglobal.pyx rename : tests/broken/cstringmeth.pyx => tests/run/cstringmeth.pyx rename : tests/broken/extcmethod.pyx => tests/run/extcmethod.pyx rename : tests/broken/extpropertyref.pyx => tests/run/extpropertyref.pyx rename : tests/broken/filenames.pxi => tests/run/filenames.pxi rename : tests/broken/filenames.pyx => tests/run/filenames.pyx rename : tests/broken/inhcmethcall.pyx => tests/run/inhcmethcall.pyx rename : tests/broken/king1.pyx => tests/run/king1.pyx rename : tests/broken/menten1.pyx => tests/run/menten1.pyx rename : tests/broken/nononetypecheck.pyx => tests/run/nononetypecheck.pyx rename : tests/broken/tandemstats.pyx => tests/run/tandemstats.pyx rename : tests/broken/watts1.pyx => tests/run/watts1.pyx --- tests/broken/ass2cglobal.pyx | 7 ---- tests/broken/cstringmeth.pyx | 2 - tests/broken/extcmethod.pyx | 15 ------- tests/broken/filenames.pxi | 1 - tests/broken/filenames.pyx | 4 -- tests/broken/inhcmethcall.pyx | 10 ----- tests/broken/king1.pyx | 7 ---- tests/broken/tandemstats.pyx | 4 -- tests/broken/watts1.pyx | 4 -- tests/{broken => compile}/arraytoptrarg.pyx | 0 tests/{broken => compile}/ass2longlong.pyx | 0 tests/{broken => compile}/builtinfuncs.pyx | 0 tests/{broken => compile}/cascmp.pyx | 0 tests/{broken => compile}/cassign.pyx | 0 tests/{broken => compile}/casttoexttype.pyx | 0 tests/{broken => compile}/cnamespec.pyx | 0 tests/{broken => compile}/cnumop.pyx | 0 tests/{broken => compile}/cunsignedlong.pyx | 0 tests/{broken => compile}/del.pyx | 0 tests/{broken => compile}/delslice.pyx | 0 tests/{broken => compile}/drake1.pyx | 0 tests/{broken => compile}/eqcmp.pyx | 1 - tests/{broken => compile}/ewing1.pyx | 0 tests/{broken => compile}/ewing5.pyx | 0 tests/{broken => compile}/excvalcheck.pyx | 0 tests/{broken => compile}/excvalreturn.pyx | 0 tests/{broken => compile}/extcoerce.pyx | 6 --- tests/{broken => compile}/extdescrdel.pyx | 0 tests/{broken => compile}/extdescrget.pyx | 0 tests/{broken => compile}/extdescrset.pyx | 0 tests/{broken => compile}/extexttype.pyx | 0 tests/{broken => compile}/extgetitem.pyx | 0 tests/{broken => compile}/extinheritdel.pyx | 3 -- tests/{broken => compile}/extinheritset.pyx | 3 -- tests/{broken => compile}/extpropertyall.pyx | 0 tests/{broken => compile}/extpymemberdef.pyx | 0 tests/compile/food.h | 1 + tests/{broken => compile}/forfromelse.pyx | 0 tests/{broken => compile}/gencall.pyx | 0 tests/{broken => compile}/globalstmt.pyx | 0 tests/{broken => compile}/gustafsson2.pyx | 0 tests/{broken => compile}/index.pyx | 0 tests/{broken => compile}/jiba5.pyx | 0 tests/{broken => compile}/jiba6.pyx | 0 tests/{broken => compile}/johnson1.pyx | 0 tests/{broken => compile}/magcmp.pyx | 0 tests/{broken => compile}/none.pyx | 0 tests/{broken => compile}/notnonearg.pyx | 0 tests/{broken => compile}/r_pernici1.pyx | 7 ++++ tests/{broken => compile}/slicex.pyx | 0 tests/{broken => compile}/traceback.pyx | 0 tests/{broken => compile}/watts2.pyx | 0 tests/{broken => run}/anonymousenum.pyx | 6 +++ tests/run/ass2cglobal.pyx | 24 +++++++++++ tests/run/cstringmeth.pyx | 15 +++++++ tests/run/extcmethod.pyx | 42 ++++++++++++++++++++ tests/{broken => run}/extpropertyref.pyx | 12 ++++-- tests/run/filenames.pxi | 1 + tests/run/filenames.pyx | 11 +++++ tests/run/inhcmethcall.pyx | 20 ++++++++++ tests/run/king1.pyx | 12 ++++++ tests/{broken => run}/menten1.pyx | 8 +++- tests/{broken => run}/nononetypecheck.pyx | 6 ++- tests/run/tandemstats.pyx | 12 ++++++ tests/run/watts1.pyx | 11 +++++ 65 files changed, 183 insertions(+), 72 deletions(-) delete mode 100644 tests/broken/ass2cglobal.pyx delete mode 100644 tests/broken/cstringmeth.pyx delete mode 100644 tests/broken/extcmethod.pyx delete mode 100644 tests/broken/filenames.pxi delete mode 100644 tests/broken/filenames.pyx delete mode 100644 tests/broken/inhcmethcall.pyx delete mode 100644 tests/broken/king1.pyx delete mode 100644 tests/broken/tandemstats.pyx delete mode 100644 tests/broken/watts1.pyx rename tests/{broken => compile}/arraytoptrarg.pyx (100%) rename tests/{broken => compile}/ass2longlong.pyx (100%) rename tests/{broken => compile}/builtinfuncs.pyx (100%) rename tests/{broken => compile}/cascmp.pyx (100%) rename tests/{broken => compile}/cassign.pyx (100%) rename tests/{broken => compile}/casttoexttype.pyx (100%) rename tests/{broken => compile}/cnamespec.pyx (100%) rename tests/{broken => compile}/cnumop.pyx (100%) rename tests/{broken => compile}/cunsignedlong.pyx (100%) rename tests/{broken => compile}/del.pyx (100%) rename tests/{broken => compile}/delslice.pyx (100%) rename tests/{broken => compile}/drake1.pyx (100%) rename tests/{broken => compile}/eqcmp.pyx (91%) rename tests/{broken => compile}/ewing1.pyx (100%) rename tests/{broken => compile}/ewing5.pyx (100%) rename tests/{broken => compile}/excvalcheck.pyx (100%) rename tests/{broken => compile}/excvalreturn.pyx (100%) rename tests/{broken => compile}/extcoerce.pyx (63%) rename tests/{broken => compile}/extdescrdel.pyx (100%) rename tests/{broken => compile}/extdescrget.pyx (100%) rename tests/{broken => compile}/extdescrset.pyx (100%) rename tests/{broken => compile}/extexttype.pyx (100%) rename tests/{broken => compile}/extgetitem.pyx (100%) rename tests/{broken => compile}/extinheritdel.pyx (78%) rename tests/{broken => compile}/extinheritset.pyx (78%) rename tests/{broken => compile}/extpropertyall.pyx (100%) rename tests/{broken => compile}/extpymemberdef.pyx (100%) create mode 100644 tests/compile/food.h rename tests/{broken => compile}/forfromelse.pyx (100%) rename tests/{broken => compile}/gencall.pyx (100%) rename tests/{broken => compile}/globalstmt.pyx (100%) rename tests/{broken => compile}/gustafsson2.pyx (100%) rename tests/{broken => compile}/index.pyx (100%) rename tests/{broken => compile}/jiba5.pyx (100%) rename tests/{broken => compile}/jiba6.pyx (100%) rename tests/{broken => compile}/johnson1.pyx (100%) rename tests/{broken => compile}/magcmp.pyx (100%) rename tests/{broken => compile}/none.pyx (100%) rename tests/{broken => compile}/notnonearg.pyx (100%) rename tests/{broken => compile}/r_pernici1.pyx (69%) rename tests/{broken => compile}/slicex.pyx (100%) rename tests/{broken => compile}/traceback.pyx (100%) rename tests/{broken => compile}/watts2.pyx (100%) rename tests/{broken => run}/anonymousenum.pyx (63%) create mode 100644 tests/run/ass2cglobal.pyx create mode 100644 tests/run/cstringmeth.pyx create mode 100644 tests/run/extcmethod.pyx rename tests/{broken => run}/extpropertyref.pyx (56%) create mode 100644 tests/run/filenames.pxi create mode 100644 tests/run/filenames.pyx create mode 100644 tests/run/inhcmethcall.pyx create mode 100644 tests/run/king1.pyx rename tests/{broken => run}/menten1.pyx (61%) rename tests/{broken => run}/nononetypecheck.pyx (63%) create mode 100644 tests/run/tandemstats.pyx create mode 100644 tests/run/watts1.pyx diff --git a/tests/broken/ass2cglobal.pyx b/tests/broken/ass2cglobal.pyx deleted file mode 100644 index f0496473..00000000 --- a/tests/broken/ass2cglobal.pyx +++ /dev/null @@ -1,7 +0,0 @@ -cdef int i -cdef x - -def f(a): - global i, x - i = 42 - x = a diff --git a/tests/broken/cstringmeth.pyx b/tests/broken/cstringmeth.pyx deleted file mode 100644 index 389c0a53..00000000 --- a/tests/broken/cstringmeth.pyx +++ /dev/null @@ -1,2 +0,0 @@ -x = "foo".join(y) - diff --git a/tests/broken/extcmethod.pyx b/tests/broken/extcmethod.pyx deleted file mode 100644 index 44d1eb38..00000000 --- a/tests/broken/extcmethod.pyx +++ /dev/null @@ -1,15 +0,0 @@ -cdef class Spam: - - cdef int tons - - cdef void add_tons(self, int x): - self.tons = self.tons + x - - cdef void eat(self): - self.tons = 0 - - -cdef class SuperSpam(Spam): - - cdef void add_tons(self, int x): - self.tons = self.tons + 2 * x diff --git a/tests/broken/filenames.pxi b/tests/broken/filenames.pxi deleted file mode 100644 index c45d71ce..00000000 --- a/tests/broken/filenames.pxi +++ /dev/null @@ -1 +0,0 @@ -spam = "ftang" diff --git a/tests/broken/filenames.pyx b/tests/broken/filenames.pyx deleted file mode 100644 index ae7f419c..00000000 --- a/tests/broken/filenames.pyx +++ /dev/null @@ -1,4 +0,0 @@ -include "filenames.pxi" - -foo = 42 - diff --git a/tests/broken/inhcmethcall.pyx b/tests/broken/inhcmethcall.pyx deleted file mode 100644 index 1793f355..00000000 --- a/tests/broken/inhcmethcall.pyx +++ /dev/null @@ -1,10 +0,0 @@ -cdef class Parrot: - - cdef void describe(self): - pass - - -cdef class Norwegian(Parrot): - - cdef void describe(self): - Parrot.describe(self) diff --git a/tests/broken/king1.pyx b/tests/broken/king1.pyx deleted file mode 100644 index 507b2c23..00000000 --- a/tests/broken/king1.pyx +++ /dev/null @@ -1,7 +0,0 @@ -DEF STUFF = "Spam" - -cdef void f(): - IF STUFF == "Spam": - print "It works!" - ELSE: - print "Doesn't work" diff --git a/tests/broken/tandemstats.pyx b/tests/broken/tandemstats.pyx deleted file mode 100644 index 91e5ba87..00000000 --- a/tests/broken/tandemstats.pyx +++ /dev/null @@ -1,4 +0,0 @@ -cdef int i, j, k -i = 17; j = 42; k = i * j -if j > k: i = 88 -else: i = 99; j = k diff --git a/tests/broken/watts1.pyx b/tests/broken/watts1.pyx deleted file mode 100644 index 68eab309..00000000 --- a/tests/broken/watts1.pyx +++ /dev/null @@ -1,4 +0,0 @@ -def test(): - cdef int a,b - foo=(55,66) - a,b=foo diff --git a/tests/broken/arraytoptrarg.pyx b/tests/compile/arraytoptrarg.pyx similarity index 100% rename from tests/broken/arraytoptrarg.pyx rename to tests/compile/arraytoptrarg.pyx diff --git a/tests/broken/ass2longlong.pyx b/tests/compile/ass2longlong.pyx similarity index 100% rename from tests/broken/ass2longlong.pyx rename to tests/compile/ass2longlong.pyx diff --git a/tests/broken/builtinfuncs.pyx b/tests/compile/builtinfuncs.pyx similarity index 100% rename from tests/broken/builtinfuncs.pyx rename to tests/compile/builtinfuncs.pyx diff --git a/tests/broken/cascmp.pyx b/tests/compile/cascmp.pyx similarity index 100% rename from tests/broken/cascmp.pyx rename to tests/compile/cascmp.pyx diff --git a/tests/broken/cassign.pyx b/tests/compile/cassign.pyx similarity index 100% rename from tests/broken/cassign.pyx rename to tests/compile/cassign.pyx diff --git a/tests/broken/casttoexttype.pyx b/tests/compile/casttoexttype.pyx similarity index 100% rename from tests/broken/casttoexttype.pyx rename to tests/compile/casttoexttype.pyx diff --git a/tests/broken/cnamespec.pyx b/tests/compile/cnamespec.pyx similarity index 100% rename from tests/broken/cnamespec.pyx rename to tests/compile/cnamespec.pyx diff --git a/tests/broken/cnumop.pyx b/tests/compile/cnumop.pyx similarity index 100% rename from tests/broken/cnumop.pyx rename to tests/compile/cnumop.pyx diff --git a/tests/broken/cunsignedlong.pyx b/tests/compile/cunsignedlong.pyx similarity index 100% rename from tests/broken/cunsignedlong.pyx rename to tests/compile/cunsignedlong.pyx diff --git a/tests/broken/del.pyx b/tests/compile/del.pyx similarity index 100% rename from tests/broken/del.pyx rename to tests/compile/del.pyx diff --git a/tests/broken/delslice.pyx b/tests/compile/delslice.pyx similarity index 100% rename from tests/broken/delslice.pyx rename to tests/compile/delslice.pyx diff --git a/tests/broken/drake1.pyx b/tests/compile/drake1.pyx similarity index 100% rename from tests/broken/drake1.pyx rename to tests/compile/drake1.pyx diff --git a/tests/broken/eqcmp.pyx b/tests/compile/eqcmp.pyx similarity index 91% rename from tests/broken/eqcmp.pyx rename to tests/compile/eqcmp.pyx index fbc810e2..c799c86d 100644 --- a/tests/broken/eqcmp.pyx +++ b/tests/compile/eqcmp.pyx @@ -4,7 +4,6 @@ cdef void foo(): cdef char *ptr1, *ptr2 cdef int *ptr3 bool = int1 == int2 - bool = int1 <> int2 bool = int1 != int2 bool = float1 == float2 bool = ptr1 == ptr2 diff --git a/tests/broken/ewing1.pyx b/tests/compile/ewing1.pyx similarity index 100% rename from tests/broken/ewing1.pyx rename to tests/compile/ewing1.pyx diff --git a/tests/broken/ewing5.pyx b/tests/compile/ewing5.pyx similarity index 100% rename from tests/broken/ewing5.pyx rename to tests/compile/ewing5.pyx diff --git a/tests/broken/excvalcheck.pyx b/tests/compile/excvalcheck.pyx similarity index 100% rename from tests/broken/excvalcheck.pyx rename to tests/compile/excvalcheck.pyx diff --git a/tests/broken/excvalreturn.pyx b/tests/compile/excvalreturn.pyx similarity index 100% rename from tests/broken/excvalreturn.pyx rename to tests/compile/excvalreturn.pyx diff --git a/tests/broken/extcoerce.pyx b/tests/compile/extcoerce.pyx similarity index 63% rename from tests/broken/extcoerce.pyx rename to tests/compile/extcoerce.pyx index 7533d4bb..613ead8a 100644 --- a/tests/broken/extcoerce.pyx +++ b/tests/compile/extcoerce.pyx @@ -2,12 +2,6 @@ cdef class Grail: def __add__(int x, float y): pass - - def __getslice__(self, i, j): - pass - - def __setslice__(self, Py_ssize_t i, float j, x): - pass cdef class Swallow: pass diff --git a/tests/broken/extdescrdel.pyx b/tests/compile/extdescrdel.pyx similarity index 100% rename from tests/broken/extdescrdel.pyx rename to tests/compile/extdescrdel.pyx diff --git a/tests/broken/extdescrget.pyx b/tests/compile/extdescrget.pyx similarity index 100% rename from tests/broken/extdescrget.pyx rename to tests/compile/extdescrget.pyx diff --git a/tests/broken/extdescrset.pyx b/tests/compile/extdescrset.pyx similarity index 100% rename from tests/broken/extdescrset.pyx rename to tests/compile/extdescrset.pyx diff --git a/tests/broken/extexttype.pyx b/tests/compile/extexttype.pyx similarity index 100% rename from tests/broken/extexttype.pyx rename to tests/compile/extexttype.pyx diff --git a/tests/broken/extgetitem.pyx b/tests/compile/extgetitem.pyx similarity index 100% rename from tests/broken/extgetitem.pyx rename to tests/compile/extgetitem.pyx diff --git a/tests/broken/extinheritdel.pyx b/tests/compile/extinheritdel.pyx similarity index 78% rename from tests/broken/extinheritdel.pyx rename to tests/compile/extinheritdel.pyx index f1db8e9b..359fdc42 100644 --- a/tests/broken/extinheritdel.pyx +++ b/tests/compile/extinheritdel.pyx @@ -5,9 +5,6 @@ cdef class Norwegian(Parrot): def __delitem__(self, i): pass - - def __delslice__(self, i, j): - pass def __delattr__(self, n): pass diff --git a/tests/broken/extinheritset.pyx b/tests/compile/extinheritset.pyx similarity index 78% rename from tests/broken/extinheritset.pyx rename to tests/compile/extinheritset.pyx index a06b5ccc..81fcf3ad 100644 --- a/tests/broken/extinheritset.pyx +++ b/tests/compile/extinheritset.pyx @@ -5,9 +5,6 @@ cdef class Norwegian(Parrot): def __setitem__(self, i, x): pass - - def __setslice__(self, i, j, x): - pass def __setattr__(self, n, x): pass diff --git a/tests/broken/extpropertyall.pyx b/tests/compile/extpropertyall.pyx similarity index 100% rename from tests/broken/extpropertyall.pyx rename to tests/compile/extpropertyall.pyx diff --git a/tests/broken/extpymemberdef.pyx b/tests/compile/extpymemberdef.pyx similarity index 100% rename from tests/broken/extpymemberdef.pyx rename to tests/compile/extpymemberdef.pyx diff --git a/tests/compile/food.h b/tests/compile/food.h new file mode 100644 index 00000000..00af7f47 --- /dev/null +++ b/tests/compile/food.h @@ -0,0 +1 @@ +struct Tomato { PyObject_HEAD }; struct Bicycle{ PyObject_HEAD }; \ No newline at end of file diff --git a/tests/broken/forfromelse.pyx b/tests/compile/forfromelse.pyx similarity index 100% rename from tests/broken/forfromelse.pyx rename to tests/compile/forfromelse.pyx diff --git a/tests/broken/gencall.pyx b/tests/compile/gencall.pyx similarity index 100% rename from tests/broken/gencall.pyx rename to tests/compile/gencall.pyx diff --git a/tests/broken/globalstmt.pyx b/tests/compile/globalstmt.pyx similarity index 100% rename from tests/broken/globalstmt.pyx rename to tests/compile/globalstmt.pyx diff --git a/tests/broken/gustafsson2.pyx b/tests/compile/gustafsson2.pyx similarity index 100% rename from tests/broken/gustafsson2.pyx rename to tests/compile/gustafsson2.pyx diff --git a/tests/broken/index.pyx b/tests/compile/index.pyx similarity index 100% rename from tests/broken/index.pyx rename to tests/compile/index.pyx diff --git a/tests/broken/jiba5.pyx b/tests/compile/jiba5.pyx similarity index 100% rename from tests/broken/jiba5.pyx rename to tests/compile/jiba5.pyx diff --git a/tests/broken/jiba6.pyx b/tests/compile/jiba6.pyx similarity index 100% rename from tests/broken/jiba6.pyx rename to tests/compile/jiba6.pyx diff --git a/tests/broken/johnson1.pyx b/tests/compile/johnson1.pyx similarity index 100% rename from tests/broken/johnson1.pyx rename to tests/compile/johnson1.pyx diff --git a/tests/broken/magcmp.pyx b/tests/compile/magcmp.pyx similarity index 100% rename from tests/broken/magcmp.pyx rename to tests/compile/magcmp.pyx diff --git a/tests/broken/none.pyx b/tests/compile/none.pyx similarity index 100% rename from tests/broken/none.pyx rename to tests/compile/none.pyx diff --git a/tests/broken/notnonearg.pyx b/tests/compile/notnonearg.pyx similarity index 100% rename from tests/broken/notnonearg.pyx rename to tests/compile/notnonearg.pyx diff --git a/tests/broken/r_pernici1.pyx b/tests/compile/r_pernici1.pyx similarity index 69% rename from tests/broken/r_pernici1.pyx rename to tests/compile/r_pernici1.pyx index df97cb50..6425c3c7 100644 --- a/tests/broken/r_pernici1.pyx +++ b/tests/compile/r_pernici1.pyx @@ -1,3 +1,10 @@ +__doc__ = u""" +>>> main() +3.14159265358979323846 +3.14159265358979323846 +3.14159265358979323846 +""" + cdef extern from "math.h": double M_PI diff --git a/tests/broken/slicex.pyx b/tests/compile/slicex.pyx similarity index 100% rename from tests/broken/slicex.pyx rename to tests/compile/slicex.pyx diff --git a/tests/broken/traceback.pyx b/tests/compile/traceback.pyx similarity index 100% rename from tests/broken/traceback.pyx rename to tests/compile/traceback.pyx diff --git a/tests/broken/watts2.pyx b/tests/compile/watts2.pyx similarity index 100% rename from tests/broken/watts2.pyx rename to tests/compile/watts2.pyx diff --git a/tests/broken/anonymousenum.pyx b/tests/run/anonymousenum.pyx similarity index 63% rename from tests/broken/anonymousenum.pyx rename to tests/run/anonymousenum.pyx index 65d4c173..238a636e 100644 --- a/tests/broken/anonymousenum.pyx +++ b/tests/run/anonymousenum.pyx @@ -1,3 +1,8 @@ +__doc__ = u""" +>>> p +42 +""" + cdef enum: spam = 42 grail = 17 @@ -5,3 +10,4 @@ cdef enum: cdef int i i = spam +p = i diff --git a/tests/run/ass2cglobal.pyx b/tests/run/ass2cglobal.pyx new file mode 100644 index 00000000..d698d6c6 --- /dev/null +++ b/tests/run/ass2cglobal.pyx @@ -0,0 +1,24 @@ +__doc__ = u""" +>>> what() +0 5 +>>> f(5) +>>> what() +42 5 +>>> f(6) +>>> what() +42 6 +>>> f("spam") +>>> what() +42 spam +""" + +cdef int i = 0 +cdef x = 5 + +def f(a): + global i, x + i = 42 + x = a + +def what(): + print i,x diff --git a/tests/run/cstringmeth.pyx b/tests/run/cstringmeth.pyx new file mode 100644 index 00000000..46782004 --- /dev/null +++ b/tests/run/cstringmeth.pyx @@ -0,0 +1,15 @@ +__doc__ = u""" +>>> y +(b'1', b'2', b'3') +>>> x +b'1foo2foo3' +""" + +import sys +if sys.version_info[0] < 3: + __doc__ = __doc__.replace(u"b'", u"'") + + +y = ('1','2','3') + +x = 'foo'.join(y) diff --git a/tests/run/extcmethod.pyx b/tests/run/extcmethod.pyx new file mode 100644 index 00000000..d628760e --- /dev/null +++ b/tests/run/extcmethod.pyx @@ -0,0 +1,42 @@ +__doc__ = u""" +>>> test() +5 +0 +20 +5 +""" + +cdef class Spam: + + cdef int tons + + cdef void add_tons(self, int x): + self.tons = self.tons + x + + cdef void eat(self): + self.tons = 0 + + def lift(self): + print self.tons + +cdef class SuperSpam(Spam): + + cdef void add_tons(self, int x): + self.tons = self.tons + 2 * x + +def test(): + cdef Spam s + cdef SuperSpam ss + s = Spam() + s.eat() + s.add_tons(5) + s.lift() + + ss = SuperSpam() + ss.eat() + ss.lift() + + ss.add_tons(10) + ss.lift() + + s.lift() diff --git a/tests/broken/extpropertyref.pyx b/tests/run/extpropertyref.pyx similarity index 56% rename from tests/broken/extpropertyref.pyx rename to tests/run/extpropertyref.pyx index 86609eb6..872d028b 100644 --- a/tests/broken/extpropertyref.pyx +++ b/tests/run/extpropertyref.pyx @@ -1,12 +1,18 @@ +__doc__ = u""" +>>> tomato() +42 +""" + cdef class Spam: property eggs: def __get__(self): - pass + return 42 -cdef void tomato(): +def tomato(): cdef Spam spam cdef object lettuce + spam = Spam() lettuce = spam.eggs - + return lettuce diff --git a/tests/run/filenames.pxi b/tests/run/filenames.pxi new file mode 100644 index 00000000..88bf454a --- /dev/null +++ b/tests/run/filenames.pxi @@ -0,0 +1 @@ +spam = u"ftang" diff --git a/tests/run/filenames.pyx b/tests/run/filenames.pyx new file mode 100644 index 00000000..8f7587fa --- /dev/null +++ b/tests/run/filenames.pyx @@ -0,0 +1,11 @@ +__doc__ = u""" +>>> print(spam) +ftang +>>> foo +42 +""" + +include "filenames.pxi" + +foo = 42 + diff --git a/tests/run/inhcmethcall.pyx b/tests/run/inhcmethcall.pyx new file mode 100644 index 00000000..7ea25584 --- /dev/null +++ b/tests/run/inhcmethcall.pyx @@ -0,0 +1,20 @@ +__doc__ = u""" +>>> p = Norwegian() +>>> p.describe() +Norwegian +Parrot +""" + +cdef class Parrot: + + cdef void _describe(self): + print u"Parrot" + + def describe(self): + self._describe() + +cdef class Norwegian(Parrot): + + cdef void _describe(self): + print u"Norwegian" + Parrot._describe(self) diff --git a/tests/run/king1.pyx b/tests/run/king1.pyx new file mode 100644 index 00000000..91bbfc27 --- /dev/null +++ b/tests/run/king1.pyx @@ -0,0 +1,12 @@ +__doc__ = u""" +>>> f() +It works! +""" + +DEF STUFF = "Spam" + +def f(): + IF STUFF == "Spam": + print u"It works!" + ELSE: + print u"Doesn't work" diff --git a/tests/broken/menten1.pyx b/tests/run/menten1.pyx similarity index 61% rename from tests/broken/menten1.pyx rename to tests/run/menten1.pyx index d788e7e5..17de85e8 100644 --- a/tests/broken/menten1.pyx +++ b/tests/run/menten1.pyx @@ -1,5 +1,11 @@ -cdef loops(): +__doc__ = u""" +>>> loops() +5 +""" + +def loops(): cdef int k for i from 0 <= i < 5: for j from 0 <= j < 2: k = i + j + return k diff --git a/tests/broken/nononetypecheck.pyx b/tests/run/nononetypecheck.pyx similarity index 63% rename from tests/broken/nononetypecheck.pyx rename to tests/run/nononetypecheck.pyx index 2933bc1e..7a03f4ab 100644 --- a/tests/broken/nononetypecheck.pyx +++ b/tests/run/nononetypecheck.pyx @@ -1,8 +1,12 @@ +__doc__ = u""" +>>> g() +""" + cdef class Spam: pass cdef f(Spam s): pass -cdef g(): +def g(): f(None) diff --git a/tests/run/tandemstats.pyx b/tests/run/tandemstats.pyx new file mode 100644 index 00000000..fa926e55 --- /dev/null +++ b/tests/run/tandemstats.pyx @@ -0,0 +1,12 @@ +__doc__ = u""" +>>> result() == (99, 17*42, 17*42) +True +""" + +cdef int i, j, k +i = 17; j = 42; k = i * j +if j > k: i = 88 +else: i = 99; j = k + +def result(): + return (i,j,k) diff --git a/tests/run/watts1.pyx b/tests/run/watts1.pyx new file mode 100644 index 00000000..7025915f --- /dev/null +++ b/tests/run/watts1.pyx @@ -0,0 +1,11 @@ +__doc__ = u""" +>>> test() == 55 + 66 +True +""" + + +def test(): + cdef int a,b + foo=(55,66) + a,b=foo + return a + b -- 2.26.2