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
6f1c3a89
Commit
6f1c3a89
authored
Oct 30, 2010
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
new (partial) test case for ticket #582
parent
55ae33d7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
75 additions
and
0 deletions
+75
-0
tests/run/charptr_comparison_T582.pyx
tests/run/charptr_comparison_T582.pyx
+75
-0
No files found.
tests/run/charptr_comparison_T582.pyx
0 → 100644
View file @
6f1c3a89
cimport
cython
@
cython
.
test_assert_path_exists
(
'//SingleAssignmentNode'
)
#FIXME: optimise me!
#@cython.test_fail_if_path_exists('//SingleAssignmentNode//CoerceFromPyTypeNode')
def
slice_equals_literal
(
char
*
s
):
"""
>>> slice_equals_literal('abc'.encode('ASCII'))
True
>>> slice_equals_literal('aabc'.encode('ASCII'))
False
>>> slice_equals_literal('abcx'.encode('ASCII'))
True
>>> slice_equals_literal('bcx'.encode('ASCII'))
False
"""
cdef
bint
result
=
(
s
[:
3
]
==
b"abc"
)
return
result
def
slice_gt_literal
(
char
*
s
):
"""
>>> slice_gt_literal('abc'.encode('ASCII'))
False
>>> slice_gt_literal('aabc'.encode('ASCII'))
False
>>> slice_gt_literal('abcx'.encode('ASCII'))
False
>>> slice_gt_literal('bcx'.encode('ASCII'))
True
"""
cdef
bint
result
=
(
s
[:
3
]
>
b"abc"
)
return
result
def
slice_lt_literal
(
char
*
s
):
"""
>>> slice_lt_literal('abc'.encode('ASCII'))
False
>>> slice_lt_literal('aabc'.encode('ASCII'))
True
>>> slice_lt_literal('abcx'.encode('ASCII'))
False
>>> slice_lt_literal('bcx'.encode('ASCII'))
False
"""
cdef
bint
result
=
(
s
[:
3
]
<
b"abc"
)
return
result
def
slice_ge_literal
(
char
*
s
):
"""
>>> slice_ge_literal('abc'.encode('ASCII'))
True
>>> slice_ge_literal('aabc'.encode('ASCII'))
False
>>> slice_ge_literal('abcx'.encode('ASCII'))
True
>>> slice_ge_literal('bcx'.encode('ASCII'))
True
"""
cdef
bint
result
=
(
s
[:
3
]
>=
b"abc"
)
return
result
def
slice_le_literal
(
char
*
s
):
"""
>>> slice_le_literal('abc'.encode('ASCII'))
True
>>> slice_le_literal('aabc'.encode('ASCII'))
True
>>> slice_le_literal('abcx'.encode('ASCII'))
True
>>> slice_le_literal('bcx'.encode('ASCII'))
False
"""
cdef
bint
result
=
(
s
[:
3
]
<=
b"abc"
)
return
result
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