Commit 1b281f59 authored by Xavier Thompson's avatar Xavier Thompson

Add unit test for isinstanceof with const cypclass arguments

parent 48aeaa3a
......@@ -25,4 +25,23 @@ def test_insinstanceof():
cdef int r5 = isinstanceof[Derived](derived_as_base)
cdef int r6 = isinstanceof[Derived](derived)
print(r1, r2, r3, r4, r5, r6)
\ No newline at end of file
print(r1, r2, r3, r4, r5, r6)
def test_const_insinstanceof():
"""
>>> test_const_insinstanceof()
(1, 1, 1, 0, 1, 1)
"""
cdef const Base base = Base()
cdef const Base derived_as_base = Derived()
cdef const Derived derived = Derived()
cdef int r1 = isinstanceof[Base](base)
cdef int r2 = isinstanceof[Base](derived_as_base)
cdef int r3 = isinstanceof[Base](derived)
cdef int r4 = isinstanceof[Derived](base)
cdef int r5 = isinstanceof[Derived](derived_as_base)
cdef int r6 = isinstanceof[Derived](derived)
print(r1, r2, r3, r4, r5, r6)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment