Commit b8239de9 authored by Stefan Behnel's avatar Stefan Behnel

extended test case

parent c14e8aea
...@@ -8,6 +8,7 @@ DEF INT_VAL = 1 ...@@ -8,6 +8,7 @@ DEF INT_VAL = 1
def _func(a,b,c): def _func(a,b,c):
return a+b+c return a+b+c
@cython.test_fail_if_path_exists("//BinopNode")
def add(): def add():
""" """
>>> add() == 1+2+3+4 >>> add() == 1+2+3+4
...@@ -15,6 +16,7 @@ def add(): ...@@ -15,6 +16,7 @@ def add():
""" """
return 1+2+3+4 return 1+2+3+4
@cython.test_fail_if_path_exists("//BinopNode")
def add_var(a): def add_var(a):
""" """
>>> add_var(10) == 1+2+10+3+4 >>> add_var(10) == 1+2+10+3+4
...@@ -22,6 +24,7 @@ def add_var(a): ...@@ -22,6 +24,7 @@ def add_var(a):
""" """
return 1+2 +a+ 3+4 return 1+2 +a+ 3+4
@cython.test_fail_if_path_exists("//BinopNode")
def neg(): def neg():
""" """
>>> neg() == -1 -2 - (-3+4) >>> neg() == -1 -2 - (-3+4)
...@@ -29,6 +32,7 @@ def neg(): ...@@ -29,6 +32,7 @@ def neg():
""" """
return -1 -2 - (-3+4) return -1 -2 - (-3+4)
@cython.test_fail_if_path_exists("//BinopNode")
def long_int_mix(): def long_int_mix():
""" """
>>> long_int_mix() == 1 + (2 * 3) // 2 >>> long_int_mix() == 1 + (2 * 3) // 2
...@@ -39,6 +43,7 @@ def long_int_mix(): ...@@ -39,6 +43,7 @@ def long_int_mix():
""" """
return 1L + (2 * 3L) // 2 return 1L + (2 * 3L) // 2
@cython.test_fail_if_path_exists("//BinopNode")
def char_int_mix(): def char_int_mix():
""" """
>>> char_int_mix() == 1 + (ord(' ') * 3) // 2 + ord('A') >>> char_int_mix() == 1 + (ord(' ') * 3) // 2 + ord('A')
...@@ -46,6 +51,7 @@ def char_int_mix(): ...@@ -46,6 +51,7 @@ def char_int_mix():
""" """
return 1L + (c' ' * 3L) // 2 + c'A' return 1L + (c' ' * 3L) // 2 + c'A'
@cython.test_fail_if_path_exists("//BinopNode")
def int_cast(): def int_cast():
""" """
>>> int_cast() == 1 + 2 * 6000 >>> int_cast() == 1 + 2 * 6000
...@@ -53,6 +59,7 @@ def int_cast(): ...@@ -53,6 +59,7 @@ def int_cast():
""" """
return <int>(1 + 2 * 6000) return <int>(1 + 2 * 6000)
@cython.test_fail_if_path_exists("//BinopNode")
def mul(): def mul():
""" """
>>> mul() == 1*60*1000 >>> mul() == 1*60*1000
...@@ -60,6 +67,7 @@ def mul(): ...@@ -60,6 +67,7 @@ def mul():
""" """
return 1*60*1000 return 1*60*1000
@cython.test_fail_if_path_exists("//BinopNode")
def arithm(): def arithm():
""" """
>>> arithm() == 9*2+3*8//6-10 >>> arithm() == 9*2+3*8//6-10
......
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