Commit 03e7c3f7 authored by Stefan Behnel's avatar Stefan Behnel

Minor test cleanup.

parent 3b21ba3e
# mode: run
# ticket: 372 # ticket: 372
cimport cython cimport cython
...@@ -22,6 +23,7 @@ def test_modify(): ...@@ -22,6 +23,7 @@ def test_modify():
print print
return i,n return i,n
@cython.test_assert_path_exists("//ForFromStatNode") @cython.test_assert_path_exists("//ForFromStatNode")
@cython.test_fail_if_path_exists("//ForInStatNode") @cython.test_fail_if_path_exists("//ForInStatNode")
def test_negindex(): def test_negindex():
...@@ -40,6 +42,7 @@ def test_negindex(): ...@@ -40,6 +42,7 @@ def test_negindex():
n = 0 n = 0
return i,n return i,n
@cython.test_assert_path_exists("//ForFromStatNode", @cython.test_assert_path_exists("//ForFromStatNode",
"//ForFromStatNode//PrintStatNode//CoerceToPyTypeNode") "//ForFromStatNode//PrintStatNode//CoerceToPyTypeNode")
@cython.test_fail_if_path_exists("//ForInStatNode") @cython.test_fail_if_path_exists("//ForInStatNode")
...@@ -58,6 +61,7 @@ def test_negindex_inferred(): ...@@ -58,6 +61,7 @@ def test_negindex_inferred():
n = 0 n = 0
return i,n return i,n
@cython.test_assert_path_exists("//ForFromStatNode") @cython.test_assert_path_exists("//ForFromStatNode")
@cython.test_fail_if_path_exists("//ForInStatNode") @cython.test_fail_if_path_exists("//ForInStatNode")
def test_fix(): def test_fix():
...@@ -77,6 +81,7 @@ def test_fix(): ...@@ -77,6 +81,7 @@ def test_fix():
print print
return i return i
@cython.test_assert_path_exists("//ForFromStatNode") @cython.test_assert_path_exists("//ForFromStatNode")
@cython.test_fail_if_path_exists("//ForInStatNode") @cython.test_fail_if_path_exists("//ForInStatNode")
def test_break(): def test_break():
...@@ -99,6 +104,7 @@ def test_break(): ...@@ -99,6 +104,7 @@ def test_break():
print print
return i,n return i,n
@cython.test_assert_path_exists("//ForFromStatNode") @cython.test_assert_path_exists("//ForFromStatNode")
@cython.test_fail_if_path_exists("//ForInStatNode") @cython.test_fail_if_path_exists("//ForInStatNode")
def test_return(): def test_return():
...@@ -135,5 +141,6 @@ def test_enum_range(): ...@@ -135,5 +141,6 @@ def test_enum_range():
""" """
cdef RangeEnum n = EnumValue3 cdef RangeEnum n = EnumValue3
for i in range(n): for i in range(n):
assert 0 <= <int>i < <int>n
assert cython.typeof(i) == "RangeEnum", cython.typeof(i) assert cython.typeof(i) == "RangeEnum", cython.typeof(i)
return cython.typeof(i) return cython.typeof(i)
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