make test case actually do stuff
authorStefan Behnel <scoder@users.berlios.de>
Sat, 26 Apr 2008 12:44:44 +0000 (14:44 +0200)
committerStefan Behnel <scoder@users.berlios.de>
Sat, 26 Apr 2008 12:44:44 +0000 (14:44 +0200)
--HG--
rename : tests/compile/pylistsubtype.pyx => tests/run/pylistsubtype.pyx

tests/compile/pylistsubtype.pyx [deleted file]
tests/run/pylistsubtype.pyx [new file with mode: 0644]

diff --git a/tests/compile/pylistsubtype.pyx b/tests/compile/pylistsubtype.pyx
deleted file mode 100644 (file)
index fefcade..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-cdef extern from *:
-    ctypedef class __builtin__.list [ object PyListObject ]:
-        pass
-
-cdef class Sub2(list):
-    cdef char character
-
-cdef class Sub1(Sub2):
-    cdef char character
diff --git a/tests/run/pylistsubtype.pyx b/tests/run/pylistsubtype.pyx
new file mode 100644 (file)
index 0000000..b880fe9
--- /dev/null
@@ -0,0 +1,32 @@
+__doc__ = """
+    >>> l1 = Sub1([1,2,3])
+    >>> len(l1)
+    3
+
+    >>> l2 = Sub2([1,2,3])
+    >>> len(l2)
+    3
+
+    >>> isinstance(l1, list)
+    True
+    >>> isinstance(l2, list)
+    True
+    >>> isinstance(l1, Sub1)
+    True
+    >>> isinstance(l1, Sub2)
+    True
+    >>> isinstance(l2, Sub1)
+    False
+    >>> isinstance(l2, Sub2)
+    True
+"""
+
+cdef extern from *:
+    ctypedef class __builtin__.list [ object PyListObject ]:
+        pass
+
+cdef class Sub2(list):
+    cdef char character
+
+cdef class Sub1(Sub2):
+    cdef char character