Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
nexedi
cython
Commits
4fba3bc1
Commit
4fba3bc1
authored
Apr 22, 2010
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
extended test case
parent
f0ae7186
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
0 deletions
+24
-0
tests/run/for_in_string.pyx
tests/run/for_in_string.pyx
+24
-0
No files found.
tests/run/for_in_string.pyx
View file @
4fba3bc1
...
...
@@ -2,9 +2,13 @@ cimport cython
bytes_abc
=
b'abc'
bytes_ABC
=
b'ABC'
bytes_abc_null
=
b'a
\
0
b
\
0
c'
bytes_ABC_null
=
b'A
\
0
B
\
0
C'
unicode_abc
=
u'abc'
unicode_ABC
=
u'ABC'
unicode_abc_null
=
u'a
\
0
b
\
0
c'
unicode_ABC_null
=
u'A
\
0
B
\
0
C'
def
for_in_bytes
(
bytes
s
):
...
...
@@ -13,6 +17,10 @@ def for_in_bytes(bytes s):
'X'
>>> for_in_bytes(bytes_ABC)
'C'
>>> for_in_bytes(bytes_abc_null)
'X'
>>> for_in_bytes(bytes_ABC_null)
'C'
"""
for
c
in
s
:
# Py2/Py3
...
...
@@ -29,6 +37,10 @@ def for_char_in_bytes(bytes s):
'X'
>>> for_char_in_bytes(bytes_ABC)
'C'
>>> for_char_in_bytes(bytes_abc_null)
'X'
>>> for_char_in_bytes(bytes_ABC_null)
'C'
"""
cdef
char
c
for
c
in
s
:
...
...
@@ -45,6 +57,10 @@ def for_char_in_enumerate_bytes(bytes s):
'X'
>>> for_char_in_enumerate_bytes(bytes_ABC)
2
>>> for_char_in_enumerate_bytes(bytes_abc_null)
'X'
>>> for_char_in_enumerate_bytes(bytes_ABC_null)
4
"""
cdef
char
c
cdef
Py_ssize_t
i
...
...
@@ -62,6 +78,10 @@ def for_pyunicode_in_unicode(unicode s):
'X'
>>> for_pyunicode_in_unicode(unicode_ABC)
'C'
>>> for_pyunicode_in_unicode(unicode_abc_null)
'X'
>>> for_pyunicode_in_unicode(unicode_ABC_null)
'C'
"""
cdef
Py_UNICODE
c
for
c
in
s
:
...
...
@@ -78,6 +98,10 @@ def for_pyunicode_in_enumerate_unicode(unicode s):
'X'
>>> for_pyunicode_in_enumerate_unicode(unicode_ABC)
2
>>> for_pyunicode_in_enumerate_unicode(unicode_abc_null)
'X'
>>> for_pyunicode_in_enumerate_unicode(unicode_ABC_null)
4
"""
cdef
Py_UNICODE
c
cdef
Py_ssize_t
i
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment