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
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Gwenaël Samain
cython
Commits
b98d07fd
Commit
b98d07fd
authored
May 17, 2010
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
extended test case
parent
cabf946e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
0 deletions
+21
-0
tests/run/py_unicode_type.pyx
tests/run/py_unicode_type.pyx
+21
-0
No files found.
tests/run/py_unicode_type.pyx
View file @
b98d07fd
...
@@ -129,3 +129,24 @@ def len_uchar(Py_UNICODE uchar):
...
@@ -129,3 +129,24 @@ def len_uchar(Py_UNICODE uchar):
1
1
"""
"""
return
len
(
uchar
)
return
len
(
uchar
)
mixed_ustring
=
u'AbcDefGhIjKlmnoP'
lower_ustring
=
mixed_ustring
.
lower
()
upper_ustring
=
mixed_ustring
.
lower
()
@
cython
.
test_assert_path_exists
(
'//PythonCapiCallNode'
,
'//ForFromStatNode'
)
@
cython
.
test_fail_if_path_exists
(
'//SimpleCallNode'
,
'//ForInStatNode'
)
def
count_lower_case_characters
(
unicode
ustring
):
"""
>>> count_lower_case_characters(mixed_ustring)
10
>>> count_lower_case_characters(lower_ustring)
16
"""
cdef
Py_ssize_t
count
=
0
for
uchar
in
ustring
:
if
uchar
.
islower
():
count
+=
1
return
count
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