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

test readability

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