Commit 2c4afc4b authored by Robert Bradshaw's avatar Robert Bradshaw

Fix builtin bool tests.

parent 510c6653
from cpython.bool cimport bool
def foo(bool a):
"""
>>> foo(True)
......
cimport cython
from cpython.bool cimport bool
cdef class A:
pass
......@@ -33,7 +34,7 @@ def test_optimised():
# Optimized tests.
assert isinstance(new_type, type)
assert isinstance(bool(), bool)
assert isinstance(True, bool)
assert isinstance(int(), int)
assert isinstance(long(), long)
assert isinstance(float(), float)
......@@ -58,9 +59,8 @@ def test_optimised_tuple():
>>> test_optimised_tuple()
True
"""
assert isinstance(bool(), (bool, int, long, float, bytes, str, unicode, tuple, list, dict, set, slice))
assert isinstance(int(), (bool, int, long, float, bytes, str, unicode, tuple, list, dict, set, slice))
assert isinstance(list(), (bool, int, long, float, bytes, str, unicode, tuple, list, dict, set, slice))
assert isinstance(int(), (int, long, float, bytes, str, unicode, tuple, list, dict, set, slice))
assert isinstance(list(), (int, long, float, bytes, str, unicode, tuple, list, dict, set, slice))
return True
@cython.test_assert_path_exists('//SimpleCallNode//SimpleCallNode')
......
......@@ -4,6 +4,8 @@
cimport cython
from cython cimport typeof, infer_types
from cpython cimport bool
##################################################
# type inference tests in 'full' mode
......@@ -48,7 +50,7 @@ def builtin_types():
d = dict()
assert typeof(d) == "dict object", typeof(d)
B = bool()
assert typeof(B) == "bool object", typeof(B)
assert typeof(B) == "bool", typeof(B)
def slicing():
"""
......
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