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