Commit 819991ce authored by Stefan Behnel's avatar Stefan Behnel

several test cases for ticket 145

parent 5ced0c3f
......@@ -9,7 +9,8 @@ missing_baseclass_in_predecl_T262
cfunc_call_tuple_args_T408
cascaded_list_unpacking_T467
compile.cpp_operators
bint_binop_T145
# Pyrex regression tests that don't current work:
# CPython regression tests that don't current work:
pyregr.test_threadsignals
pyregr.test_module
def or_literal_bint():
"""
>>> True or 5
True
>>> or_literal_bint()
True
"""
return True or 5
def and_literal_bint():
"""
>>> 5 and True
True
>>> and_literal_bint()
True
"""
return 5 and True
def False_and_True_or_0():
"""
>>> False and True or 0
0
>>> False_and_True_or_0()
0
"""
return False and True or 0
def True_and_True_or_0():
"""
>>> True and True or 0
True
>>> True_and_True_or_0()
True
"""
return True and True or 0
def x_and_True_or_False(x):
"""
>>> x_and_True_or_False(0)
False
>>> x_and_True_or_False(1)
True
>>> x_and_True_or_False('abc')
True
>>> x_and_True_or_False([])
False
"""
return x and True or False
def x_and_True_or_0(x):
"""
>>> 0 and True or 0
0
>>> x_and_True_or_0(0)
0
>>> 1 and True or 0
True
>>> x_and_True_or_0(1)
True
>>> x_and_True_or_0('abc')
True
>>> x_and_True_or_0([])
0
"""
return x and True or 0
def x_and_True_or_1(x):
"""
>>> 0 and True or 1
1
>>> x_and_True_or_1(0)
1
>>> 1 and True or 1
True
>>> x_and_True_or_1(1)
True
>>> x_and_True_or_1('abc')
True
>>> x_and_True_or_1([])
1
"""
return x and True or 1
def x_and_1_or_False(x):
"""
>>> 0 and 1 or False
False
>>> x_and_1_or_False(0)
False
>>> 1 and 1 or False
1
>>> x_and_1_or_False(1)
1
>>> x_and_1_or_False('abc')
1
>>> x_and_1_or_False([])
False
"""
return x and 1 or False
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