Commit 541d268c authored by Stefan Behnel's avatar Stefan Behnel

disable invalid iteration tests on char* that assume a mixed behaviour of...

disable invalid iteration tests on char* that assume a mixed behaviour of bytes and carray iteration
parent 0725fdd8
...@@ -13,19 +13,23 @@ def slice_charptr_end(): ...@@ -13,19 +13,23 @@ def slice_charptr_end():
""" """
return cstring[:1], cstring[:3], cstring[:9] return cstring[:1], cstring[:3], cstring[:9]
@cython.test_assert_path_exists("//ForFromStatNode", #### BROKEN: this test assumes that the result of a char* iteration
"//ForFromStatNode//SliceIndexNode") #### becomes a bytes object, which is not the case when applying
@cython.test_fail_if_path_exists("//ForInStatNode") #### carray iteration. Contradiction.
def slice_charptr_for_loop_py(): ##
""" ## @cython.test_assert_path_exists("//ForFromStatNode",
>>> slice_charptr_for_loop_py() ## "//ForFromStatNode//SliceIndexNode")
['a', 'b', 'c'] ## @cython.test_fail_if_path_exists("//ForInStatNode")
['b', 'c', 'A', 'B'] ## def slice_charptr_for_loop_py():
['B', 'C', 'q', 't', 'p'] ## """
""" ## >>> slice_charptr_for_loop_py()
print str([ c for c in cstring[:3] ]).replace(" b'", " '").replace("[b'", "['") ## ['a', 'b', 'c']
print str([ c for c in cstring[1:5] ]).replace(" b'", " '").replace("[b'", "['") ## ['b', 'c', 'A', 'B']
print str([ c for c in cstring[4:9] ]).replace(" b'", " '").replace("[b'", "['") ## ['B', 'C', 'q', 't', 'p']
## """
## print str([ c for c in cstring[:3] ]).replace(" b'", " '").replace("[b'", "['")
## print str([ c for c in cstring[1:5] ]).replace(" b'", " '").replace("[b'", "['")
## print str([ c for c in cstring[4:9] ]).replace(" b'", " '").replace("[b'", "['")
@cython.test_assert_path_exists("//ForFromStatNode", @cython.test_assert_path_exists("//ForFromStatNode",
"//ForFromStatNode//IndexNode") "//ForFromStatNode//IndexNode")
...@@ -89,19 +93,23 @@ cdef return4(): return 4 ...@@ -89,19 +93,23 @@ cdef return4(): return 4
cdef return5(): return 5 cdef return5(): return 5
cdef return9(): return 9 cdef return9(): return 9
@cython.test_assert_path_exists("//ForFromStatNode", #### BROKEN: this test assumes that the result of a char* iteration
"//ForFromStatNode//SliceIndexNode") #### becomes a bytes object, which is not the case when applying
@cython.test_fail_if_path_exists("//ForInStatNode") #### carray iteration. Contradiction.
def slice_charptr_for_loop_py_enumerate(): ##
""" ## @cython.test_assert_path_exists("//ForFromStatNode",
>>> slice_charptr_for_loop_py_enumerate() ## "//ForFromStatNode//SliceIndexNode")
[(0, 'a'), (1, 'b'), (2, 'c')] ## @cython.test_fail_if_path_exists("//ForInStatNode")
[(0, 'b'), (1, 'c'), (2, 'A'), (3, 'B')] ## def slice_charptr_for_loop_py_enumerate():
[(0, 'B'), (1, 'C'), (2, 'q'), (3, 't'), (4, 'p')] ## """
""" ## >>> slice_charptr_for_loop_py_enumerate()
print str([ (i,c) for i,c in enumerate(cstring[:3]) ]).replace(" b'", " '") ## [(0, 'a'), (1, 'b'), (2, 'c')]
print str([ (i,c) for i,c in enumerate(cstring[1:5]) ]).replace(" b'", " '") ## [(0, 'b'), (1, 'c'), (2, 'A'), (3, 'B')]
print str([ (i,c) for i,c in enumerate(cstring[4:9]) ]).replace(" b'", " '") ## [(0, 'B'), (1, 'C'), (2, 'q'), (3, 't'), (4, 'p')]
## """
## print str([ (i,c) for i,c in enumerate(cstring[:3]) ]).replace(" b'", " '")
## print str([ (i,c) for i,c in enumerate(cstring[1:5]) ]).replace(" b'", " '")
## print str([ (i,c) for i,c in enumerate(cstring[4:9]) ]).replace(" b'", " '")
@cython.test_assert_path_exists("//ForFromStatNode", @cython.test_assert_path_exists("//ForFromStatNode",
"//ForFromStatNode//IndexNode") "//ForFromStatNode//IndexNode")
......
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