5
@cython.test_fail_if_path_exists('//BoolBinopNode')
15
@cython.test_fail_if_path_exists('//BoolBinopNode')
16
def and_literal_bint():
20
>>> and_literal_bint()
25
@cython.test_fail_if_path_exists('//BoolBinopNode')
26
def False_and_True_or_0():
28
>>> False and True or 0
30
>>> False_and_True_or_0()
33
return False and True or 0
35
@cython.test_fail_if_path_exists('//BoolBinopNode')
36
def True_and_True_or_0():
38
>>> True and True or 0
40
>>> True_and_True_or_0()
43
return True and True or 0
45
def x_and_True_or_False(x):
47
>>> x_and_True_or_False(0)
49
>>> x_and_True_or_False(1)
51
>>> x_and_True_or_False('abc')
53
>>> x_and_True_or_False([])
56
return x and True or False
58
def x_and_True_or_0(x):
62
>>> x_and_True_or_0(0)
67
>>> x_and_True_or_0(1)
70
>>> x_and_True_or_0('abc')
72
>>> x_and_True_or_0([])
75
return x and True or 0
77
def x_and_True_or_1(x):
81
>>> x_and_True_or_1(0)
86
>>> x_and_True_or_1(1)
89
>>> x_and_True_or_1('abc')
91
>>> x_and_True_or_1([])
94
return x and True or 1
96
def x_and_1_or_False(x):
100
>>> x_and_1_or_False(0)
105
>>> x_and_1_or_False(1)
108
>>> x_and_1_or_False('abc')
110
>>> x_and_1_or_False([])
113
return x and 1 or False
115
def test_large_int(unsigned long x):
117
>>> try: test_large_int(1 << 127)
118
... except OverflowError: print(True)
120
>>> try: test_large_int(1 << 63)
121
... except OverflowError: print(True)
123
>>> try: test_large_int(1 << 48)
124
... except OverflowError: print(True)
126
>>> try: test_large_int(1 << 31)
127
... except OverflowError: print(True)
129
>>> test_large_int(0)