Commit 8ad762d9 authored by Xavier Thompson's avatar Xavier Thompson

Add unit test for nested cypclasses

parent 5da25323
# mode: run
# tag: cpp, cpp11
# cython: experimental_cpp_class_def=True, language_level=2
cdef cypclass A nolock:
int a
cypclass B nolock:
int b
__init__(self, int b):
self.b = b
int foo(self):
return self.b
B b
__init__(self, int a, int b):
self.a = a
self.b = B(b)
int foo(self):
return self.a + self.b.foo()
def test_nested_classes():
"""
>>> test_nested_classes()
11
"""
a = A(1, 10)
return a.foo()
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