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
3b44dbd8
Commit
3b44dbd8
authored
Apr 28, 2010
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
extended test case
parent
f014d4f0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
0 deletions
+30
-0
tests/run/for_in_string.pyx
tests/run/for_in_string.pyx
+30
-0
No files found.
tests/run/for_in_string.pyx
View file @
3b44dbd8
...
...
@@ -70,6 +70,36 @@ def for_char_in_enumerate_bytes(bytes s):
else
:
return
'X'
@
cython
.
test_assert_path_exists
(
"//ForFromStatNode"
)
@
cython
.
test_fail_if_path_exists
(
"//ForInStatNode"
)
def
for_pyvar_in_char_ptr
(
char
*
c_string
):
"""
>>> for_pyvar_in_char_ptr( (bytes_abc+bytes_ABC) * 2 )
[True, True, True, False, False, False, True, True, True, False]
>>> for_pyvar_in_char_ptr( bytes_abc_null * 2 )
[True, False, True, False, True, True, False, True, False, True]
"""
in_test
=
[]
cdef
object
c
for
c
in
c_string
[:
10
]:
in_test
.
append
(
c
in
b'abc'
)
return
in_test
@
cython
.
test_assert_path_exists
(
"//ForFromStatNode"
)
@
cython
.
test_fail_if_path_exists
(
"//ForInStatNode"
)
def
for_char_in_char_ptr
(
char
*
c_string
):
"""
>>> for_char_in_char_ptr( (bytes_abc+bytes_ABC) * 2 )
[True, True, True, False, False, False, True, True, True, False]
>>> for_char_in_char_ptr( bytes_abc_null * 2 )
[True, False, True, False, True, True, False, True, False, True]
"""
in_test
=
[]
cdef
char
c
for
c
in
c_string
[:
10
]:
in_test
.
append
(
c
in
b'abc'
)
return
in_test
@
cython
.
test_assert_path_exists
(
"//ForFromStatNode"
)
@
cython
.
test_fail_if_path_exists
(
"//ForInStatNode"
)
def
for_pyunicode_in_unicode
(
unicode
s
):
...
...
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