From 39c0eea95028f06c3ef4d86ba571d4f01c7c50bd Mon Sep 17 00:00:00 2001 From: Stefan Behnel Date: Wed, 17 Feb 2010 09:33:40 +0100 Subject: [PATCH] fix test case in Py3 --- tests/run/extern_builtins_T258.pyx | 22 ++++------------------ 1 file changed, 4 insertions(+), 18 deletions(-) diff --git a/tests/run/extern_builtins_T258.pyx b/tests/run/extern_builtins_T258.pyx index 54fff17f..344cc895 100644 --- a/tests/run/extern_builtins_T258.pyx +++ b/tests/run/extern_builtins_T258.pyx @@ -1,20 +1,17 @@ cdef extern from "Python.h": - - ctypedef class __builtin__.str [object PyStringObject]: - cdef long ob_shash ctypedef class __builtin__.list [object PyListObject]: - cdef Py_ssize_t ob_size cdef Py_ssize_t allocated ctypedef class __builtin__.dict [object PyDictObject]: pass -cdef str s = "abc" + cdef Py_ssize_t Py_SIZE(object o) + cdef list L = [1,2,4] cdef dict d = {'A': 'a'} - + def test_list(list L): """ >>> test_list(list(range(10))) @@ -23,18 +20,7 @@ def test_list(list L): >>> test_list(list_subclass([1,2,3])) True """ - return L.ob_size <= L.allocated - -def test_str(str s): - """ - >>> test_str("abc") - True - >>> class str_subclass(str): pass - >>> test_str(str_subclass("xyz")) - True - """ - cdef char* ss = s - return hash(s) == s.ob_shash + return Py_SIZE(L) <= L.allocated def test_tuple(tuple t): """ -- 2.26.2