Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
nexedi
cython
Commits
a9119337
Commit
a9119337
authored
Aug 18, 2020
by
Xavier Thompson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add unit test of cypclass' isinstanceof
parent
1644bfa2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
0 deletions
+28
-0
tests/run/cypclass_isinstanceof.pyx
tests/run/cypclass_isinstanceof.pyx
+28
-0
No files found.
tests/run/cypclass_isinstanceof.pyx
0 → 100644
View file @
a9119337
# mode: run
# tag: cpp, cpp11
# cython: experimental_cpp_class_def=True, language_level=2
cdef
cypclass
Base
:
pass
cdef
cypclass
Derived
(
Base
):
pass
def
test_insinstanceof
():
"""
>>> test_insinstanceof()
(1, 1, 1, 0, 1, 1)
"""
cdef
Base
base
=
Base
()
cdef
Base
derived_as_base
=
Derived
()
cdef
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
)
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment