enabled most remaining tests from the 'broken' directory
authorStefan Behnel <scoder@users.berlios.de>
Wed, 21 May 2008 17:25:02 +0000 (19:25 +0200)
committerStefan Behnel <scoder@users.berlios.de>
Wed, 21 May 2008 17:25:02 +0000 (19:25 +0200)
--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

65 files changed:
tests/broken/ass2cglobal.pyx [deleted file]
tests/broken/cstringmeth.pyx [deleted file]
tests/broken/extcmethod.pyx [deleted file]
tests/broken/filenames.pxi [deleted file]
tests/broken/filenames.pyx [deleted file]
tests/broken/inhcmethcall.pyx [deleted file]
tests/broken/king1.pyx [deleted file]
tests/broken/tandemstats.pyx [deleted file]
tests/broken/watts1.pyx [deleted file]
tests/compile/arraytoptrarg.pyx [moved from tests/broken/arraytoptrarg.pyx with 100% similarity]
tests/compile/ass2longlong.pyx [moved from tests/broken/ass2longlong.pyx with 100% similarity]
tests/compile/builtinfuncs.pyx [moved from tests/broken/builtinfuncs.pyx with 100% similarity]
tests/compile/cascmp.pyx [moved from tests/broken/cascmp.pyx with 100% similarity]
tests/compile/cassign.pyx [moved from tests/broken/cassign.pyx with 100% similarity]
tests/compile/casttoexttype.pyx [moved from tests/broken/casttoexttype.pyx with 100% similarity]
tests/compile/cnamespec.pyx [moved from tests/broken/cnamespec.pyx with 100% similarity]
tests/compile/cnumop.pyx [moved from tests/broken/cnumop.pyx with 100% similarity]
tests/compile/cunsignedlong.pyx [moved from tests/broken/cunsignedlong.pyx with 100% similarity]
tests/compile/del.pyx [moved from tests/broken/del.pyx with 100% similarity]
tests/compile/delslice.pyx [moved from tests/broken/delslice.pyx with 100% similarity]
tests/compile/drake1.pyx [moved from tests/broken/drake1.pyx with 100% similarity]
tests/compile/eqcmp.pyx [moved from tests/broken/eqcmp.pyx with 91% similarity]
tests/compile/ewing1.pyx [moved from tests/broken/ewing1.pyx with 100% similarity]
tests/compile/ewing5.pyx [moved from tests/broken/ewing5.pyx with 100% similarity]
tests/compile/excvalcheck.pyx [moved from tests/broken/excvalcheck.pyx with 100% similarity]
tests/compile/excvalreturn.pyx [moved from tests/broken/excvalreturn.pyx with 100% similarity]
tests/compile/extcoerce.pyx [moved from tests/broken/extcoerce.pyx with 63% similarity]
tests/compile/extdescrdel.pyx [moved from tests/broken/extdescrdel.pyx with 100% similarity]
tests/compile/extdescrget.pyx [moved from tests/broken/extdescrget.pyx with 100% similarity]
tests/compile/extdescrset.pyx [moved from tests/broken/extdescrset.pyx with 100% similarity]
tests/compile/extexttype.pyx [moved from tests/broken/extexttype.pyx with 100% similarity]
tests/compile/extgetitem.pyx [moved from tests/broken/extgetitem.pyx with 100% similarity]
tests/compile/extinheritdel.pyx [moved from tests/broken/extinheritdel.pyx with 78% similarity]
tests/compile/extinheritset.pyx [moved from tests/broken/extinheritset.pyx with 78% similarity]
tests/compile/extpropertyall.pyx [moved from tests/broken/extpropertyall.pyx with 100% similarity]
tests/compile/extpymemberdef.pyx [moved from tests/broken/extpymemberdef.pyx with 100% similarity]
tests/compile/food.h [new file with mode: 0644]
tests/compile/forfromelse.pyx [moved from tests/broken/forfromelse.pyx with 100% similarity]
tests/compile/gencall.pyx [moved from tests/broken/gencall.pyx with 100% similarity]
tests/compile/globalstmt.pyx [moved from tests/broken/globalstmt.pyx with 100% similarity]
tests/compile/gustafsson2.pyx [moved from tests/broken/gustafsson2.pyx with 100% similarity]
tests/compile/index.pyx [moved from tests/broken/index.pyx with 100% similarity]
tests/compile/jiba5.pyx [moved from tests/broken/jiba5.pyx with 100% similarity]
tests/compile/jiba6.pyx [moved from tests/broken/jiba6.pyx with 100% similarity]
tests/compile/johnson1.pyx [moved from tests/broken/johnson1.pyx with 100% similarity]
tests/compile/magcmp.pyx [moved from tests/broken/magcmp.pyx with 100% similarity]
tests/compile/none.pyx [moved from tests/broken/none.pyx with 100% similarity]
tests/compile/notnonearg.pyx [moved from tests/broken/notnonearg.pyx with 100% similarity]
tests/compile/r_pernici1.pyx [moved from tests/broken/r_pernici1.pyx with 69% similarity]
tests/compile/slicex.pyx [moved from tests/broken/slicex.pyx with 100% similarity]
tests/compile/traceback.pyx [moved from tests/broken/traceback.pyx with 100% similarity]
tests/compile/watts2.pyx [moved from tests/broken/watts2.pyx with 100% similarity]
tests/run/anonymousenum.pyx [moved from tests/broken/anonymousenum.pyx with 63% similarity]
tests/run/ass2cglobal.pyx [new file with mode: 0644]
tests/run/cstringmeth.pyx [new file with mode: 0644]
tests/run/extcmethod.pyx [new file with mode: 0644]
tests/run/extpropertyref.pyx [moved from tests/broken/extpropertyref.pyx with 56% similarity]
tests/run/filenames.pxi [new file with mode: 0644]
tests/run/filenames.pyx [new file with mode: 0644]
tests/run/inhcmethcall.pyx [new file with mode: 0644]
tests/run/king1.pyx [new file with mode: 0644]
tests/run/menten1.pyx [moved from tests/broken/menten1.pyx with 61% similarity]
tests/run/nononetypecheck.pyx [moved from tests/broken/nononetypecheck.pyx with 63% similarity]
tests/run/tandemstats.pyx [new file with mode: 0644]
tests/run/watts1.pyx [new file with mode: 0644]

diff --git a/tests/broken/ass2cglobal.pyx b/tests/broken/ass2cglobal.pyx
deleted file mode 100644 (file)
index f049647..0000000
+++ /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 (file)
index 389c0a5..0000000
+++ /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 (file)
index 44d1eb3..0000000
+++ /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 (file)
index c45d71c..0000000
+++ /dev/null
@@ -1 +0,0 @@
-spam = "ftang"
diff --git a/tests/broken/filenames.pyx b/tests/broken/filenames.pyx
deleted file mode 100644 (file)
index ae7f419..0000000
+++ /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 (file)
index 1793f35..0000000
+++ /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 (file)
index 507b2c2..0000000
+++ /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 (file)
index 91e5ba8..0000000
+++ /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 (file)
index 68eab30..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-def test():
-    cdef int a,b
-    foo=(55,66)
-    a,b=foo
similarity index 100%
rename from tests/broken/del.pyx
rename to tests/compile/del.pyx
similarity index 91%
rename from tests/broken/eqcmp.pyx
rename to tests/compile/eqcmp.pyx
index fbc810e2ddeaeb667f78d7c7c3de24b720a5f771..c799c86d391db31ddc81dd3fb9ab06bc722d4e54 100644 (file)
@@ -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
similarity index 63%
rename from tests/broken/extcoerce.pyx
rename to tests/compile/extcoerce.pyx
index 7533d4bbecc0321d525ac6a4c663f59c15d593a0..613ead8a752e54ca41f729134b0d2ef169c1507a 100644 (file)
@@ -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
similarity index 78%
rename from tests/broken/extinheritdel.pyx
rename to tests/compile/extinheritdel.pyx
index f1db8e9b63bd9d62d4add7ffd3d1a09ae780f16b..359fdc4232ad11ca29db0327f3390753c27ff3dc 100644 (file)
@@ -5,9 +5,6 @@ cdef class Norwegian(Parrot):
     
     def __delitem__(self, i):
         pass
-    
-    def __delslice__(self, i, j):
-        pass
 
     def __delattr__(self, n):
         pass
similarity index 78%
rename from tests/broken/extinheritset.pyx
rename to tests/compile/extinheritset.pyx
index a06b5cccc6c76ffd361ad0a6afc51a2d3423ac84..81fcf3adb18918d3d46e3ff02bd0d4ae0dfa44e8 100644 (file)
@@ -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/compile/food.h b/tests/compile/food.h
new file mode 100644 (file)
index 0000000..00af7f4
--- /dev/null
@@ -0,0 +1 @@
+struct Tomato {\r       PyObject_HEAD\r};\r\rstruct Bicycle{\r      PyObject_HEAD\r};\r
\ No newline at end of file
similarity index 100%
rename from tests/broken/none.pyx
rename to tests/compile/none.pyx
similarity index 69%
rename from tests/broken/r_pernici1.pyx
rename to tests/compile/r_pernici1.pyx
index df97cb500173ef19eff77f7f61f88740c47631e9..6425c3c7a5b026641e097d4f69b333a611b3b07f 100644 (file)
@@ -1,3 +1,10 @@
+__doc__ = u"""
+>>> main()
+3.14159265358979323846
+3.14159265358979323846
+3.14159265358979323846
+"""
+
 cdef extern from "math.h":
   double M_PI
 
similarity index 63%
rename from tests/broken/anonymousenum.pyx
rename to tests/run/anonymousenum.pyx
index 65d4c173d72a38ba8a7d2b4ada159e00ec4ed70a..238a636e194f301be6b24c5ba357d953d8b69384 100644 (file)
@@ -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 (file)
index 0000000..d698d6c
--- /dev/null
@@ -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 (file)
index 0000000..4678200
--- /dev/null
@@ -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 (file)
index 0000000..d628760
--- /dev/null
@@ -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()
similarity index 56%
rename from tests/broken/extpropertyref.pyx
rename to tests/run/extpropertyref.pyx
index 86609eb6df695dc122e8ef800fbe3811f8a53a8e..872d028b2df7a936b4f66c7251d5d2192483156a 100644 (file)
@@ -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 (file)
index 0000000..88bf454
--- /dev/null
@@ -0,0 +1 @@
+spam = u"ftang"
diff --git a/tests/run/filenames.pyx b/tests/run/filenames.pyx
new file mode 100644 (file)
index 0000000..8f7587f
--- /dev/null
@@ -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 (file)
index 0000000..7ea2558
--- /dev/null
@@ -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 (file)
index 0000000..91bbfc2
--- /dev/null
@@ -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"
similarity index 61%
rename from tests/broken/menten1.pyx
rename to tests/run/menten1.pyx
index d788e7e5c38221ccbfab90ed4cd54210890fd3d9..17de85e858a50b81892179ee38fc5688a37eac8c 100644 (file)
@@ -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
similarity index 63%
rename from tests/broken/nononetypecheck.pyx
rename to tests/run/nononetypecheck.pyx
index 2933bc1e936e6e6b9876eb960411d1281b1fd21e..7a03f4abad064a85c2d7141a9cd84d660178f74d 100644 (file)
@@ -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 (file)
index 0000000..fa926e5
--- /dev/null
@@ -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 (file)
index 0000000..7025915
--- /dev/null
@@ -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