Commit 4658cbdc authored by Stefan Behnel's avatar Stefan Behnel

test readability

parent 573daa52
...@@ -48,41 +48,25 @@ def slice_charptr_for_loop_c(): ...@@ -48,41 +48,25 @@ def slice_charptr_for_loop_c():
def slice_charptr_for_loop_c_step(): def slice_charptr_for_loop_c_step():
""" """
>>> slice_charptr_for_loop_c_step() >>> slice_charptr_for_loop_c_step()
Acba Acba ['A', 'c', 'b', 'a']
['A', 'c', 'b', 'a'] Acba ['A', 'c', 'b', 'a']
Acba bA ['b', 'A']
['A', 'c', 'b', 'a'] acB ['a', 'c', 'B']
bA acB ['a', 'c', 'B']
['b', 'A']
acB
['a', 'c', 'B']
acB
['a', 'c', 'B']
<BLANKLINE>
[] []
ptqC ptqC ['p', 't', 'q', 'C']
['p', 't', 'q', 'C'] pq ['p', 'q']
pq
['p', 'q']
""" """
cdef unicode ustring = cstring.decode('ASCII') cdef object ustring = cstring.decode('ASCII')
cdef char c cdef char c
print ustring[3::-1] print ustring[3::-1], [ chr(c) for c in cstring[3::-1] ]
print [ chr(c) for c in cstring[3::-1] ] print ustring[3:None:-1], [ chr(c) for c in cstring[3:None:-1] ]
print ustring[3:None:-1] print ustring[1:5:2], [ chr(c) for c in cstring[1:5:2] ]
print [ chr(c) for c in cstring[3:None:-1] ] print ustring[:5:2], [ chr(c) for c in cstring[:5:2] ]
print ustring[1:5:2] print ustring[None:5:2], [ chr(c) for c in cstring[None:5:2] ]
print [ chr(c) for c in cstring[1:5:2] ] print ustring[4:9:-1], [ chr(c) for c in cstring[4:9:-1] ]
print ustring[:5:2] print ustring[8:4:-1], [ chr(c) for c in cstring[8:4:-1] ]
print [ chr(c) for c in cstring[:5:2] ] print ustring[8:4:-2], [ chr(c) for c in cstring[8:4:-2] ]
print ustring[None:5:2]
print [ chr(c) for c in cstring[None:5:2] ]
print ustring[4:9:-1]
print [ chr(c) for c in cstring[4:9:-1] ]
print ustring[8:4:-1]
print [ chr(c) for c in cstring[8:4:-1] ]
print ustring[8:4:-2]
print [ chr(c) for c in cstring[8:4:-2] ]
@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