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
Kirill Smelkov
cython
Commits
b5cfad6e
Commit
b5cfad6e
authored
Apr 22, 2010
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
extended test case
parent
b3635f53
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
0 deletions
+30
-0
tests/run/inop.pyx
tests/run/inop.pyx
+30
-0
No files found.
tests/run/inop.pyx
View file @
b5cfad6e
...
...
@@ -113,6 +113,24 @@ def m_bytes(char a, bytes bytes_string):
cdef
int
result
=
a
in
bytes_string
return
result
@
cython
.
test_assert_path_exists
(
"//PrimaryCmpNode"
)
@
cython
.
test_fail_if_path_exists
(
"//SwitchStatNode"
,
"//BoolBinopNode"
)
def
m_bytes_unsigned
(
unsigned
char
a
,
bytes
bytes_string
):
"""
>>> m_bytes(ord('f'), py_bytes_string)
1
>>> m_bytes(ord('X'), py_bytes_string)
0
>>> 'f'.encode('ASCII') in None
Traceback (most recent call last):
TypeError: argument of type 'NoneType' is not iterable
>>> m_bytes(ord('f'), None)
Traceback (most recent call last):
TypeError: argument of type 'NoneType' is not iterable
"""
cdef
int
result
=
a
in
bytes_string
return
result
@
cython
.
test_assert_path_exists
(
"//SwitchStatNode"
)
@
cython
.
test_fail_if_path_exists
(
"//BoolBinopNode"
,
"//PrimaryCmpNode"
)
def
m_bytes_literal
(
char
a
):
...
...
@@ -125,6 +143,18 @@ def m_bytes_literal(char a):
cdef
int
result
=
a
in
b'ab
\
0
cde
\
0
f
\
0
g'
return
result
@
cython
.
test_assert_path_exists
(
"//SwitchStatNode"
)
@
cython
.
test_fail_if_path_exists
(
"//BoolBinopNode"
,
"//PrimaryCmpNode"
)
def
m_bytes_literal_unsigned
(
unsigned
char
a
):
"""
>>> m_bytes_literal(ord('f'))
1
>>> m_bytes_literal(ord('X'))
0
"""
cdef
int
result
=
a
in
b'ab
\
0
cde
\
0
f
\
0
g'
return
result
cdef
unicode
unicode_string
=
u'abc
\
0
defg
\
u1234
\
uF8D2
'
py_unicode_string
=
unicode_string
...
...
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