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
78621780
Commit
78621780
authored
Sep 28, 2012
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slightly extended test case
parent
f57f9f76
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
42 additions
and
2 deletions
+42
-2
tests/run/isinstance.pyx
tests/run/isinstance.pyx
+42
-2
No files found.
tests/run/isinstance.pyx
View file @
78621780
...
...
@@ -29,23 +29,63 @@ def test_optimised():
>>> test_optimised()
True
"""
new_type
=
type
(
'a'
,(),{})
# Optimized tests.
cdef
object
new_type
=
type
(
'a'
,(),{})
assert
isinstance
(
type
(
'a'
,(),{}),
type
)
assert
isinstance
(
new_type
,
type
)
cdef
object
boolval
=
True
assert
isinstance
(
boolval
,
bool
)
assert
isinstance
(
True
,
bool
)
cdef
object
intval
=
int
()
assert
isinstance
(
intval
,
int
)
assert
isinstance
(
int
(),
int
)
cdef
object
longval
=
long
()
assert
isinstance
(
longval
,
long
)
assert
isinstance
(
long
(),
long
)
cdef
object
floatval
=
float
()
assert
isinstance
(
floatval
,
float
)
assert
isinstance
(
float
(),
float
)
cdef
object
bytesval
=
bytes
()
assert
isinstance
(
bytesval
,
bytes
)
assert
isinstance
(
bytes
(),
bytes
)
cdef
object
strval
=
str
()
assert
isinstance
(
strval
,
str
)
assert
isinstance
(
str
(),
str
)
cdef
object
unicodeval
=
unicode
()
assert
isinstance
(
unicodeval
,
unicode
)
assert
isinstance
(
unicode
(),
unicode
)
cdef
object
tupleval
=
tuple
()
assert
isinstance
(
tupleval
,
tuple
)
assert
isinstance
(
tuple
(),
tuple
)
cdef
object
listval
=
list
()
assert
isinstance
(
listval
,
list
)
assert
isinstance
(
list
(),
list
)
cdef
object
dictval
=
dict
()
assert
isinstance
(
dictval
,
dict
)
assert
isinstance
(
dict
(),
dict
)
cdef
object
setval
=
set
()
assert
isinstance
(
setval
,
set
)
assert
isinstance
(
set
(),
set
)
cdef
object
sliceval
=
slice
(
0
)
assert
isinstance
(
sliceval
,
slice
)
assert
isinstance
(
slice
(
0
),
slice
)
cdef
object
complexval
=
complex
()
assert
isinstance
(
complexval
,
complex
)
assert
isinstance
(
complex
(),
complex
)
assert
not
isinstance
(
u"foo"
,
int
)
assert
isinstance
(
A
,
type
)
assert
isinstance
(
A
(),
A
)
...
...
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