From fb25e014d92e32f345c22608a8871e721438bc52 Mon Sep 17 00:00:00 2001 From: Stefan Behnel Date: Sat, 26 Apr 2008 14:44:44 +0200 Subject: [PATCH] make test case actually do stuff --HG-- rename : tests/compile/pylistsubtype.pyx => tests/run/pylistsubtype.pyx --- tests/compile/pylistsubtype.pyx | 9 --------- tests/run/pylistsubtype.pyx | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 32 insertions(+), 9 deletions(-) delete mode 100644 tests/compile/pylistsubtype.pyx create mode 100644 tests/run/pylistsubtype.pyx diff --git a/tests/compile/pylistsubtype.pyx b/tests/compile/pylistsubtype.pyx deleted file mode 100644 index fefcade7..00000000 --- a/tests/compile/pylistsubtype.pyx +++ /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 index 00000000..b880fe93 --- /dev/null +++ b/tests/run/pylistsubtype.pyx @@ -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 -- 2.26.2