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
4e113f32
Commit
4e113f32
authored
Aug 12, 2008
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
new test case that shows broken string literal slicing behaviour
parent
8b5a6441
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
54 additions
and
0 deletions
+54
-0
tests/run/literalslice.pyx
tests/run/literalslice.pyx
+54
-0
No files found.
tests/run/literalslice.pyx
0 → 100644
View file @
4e113f32
__doc__
=
u"""
>>> test_str(1)
b'b'
>>> test_unicode_ascii(2)
u'c'
>>> test_unicode(0)
u'
\
u00fc
'
>>> test_int_list(2)
3
>>> test_str_list(1)
b'bcd'
>>> test_int_tuple(2)
3
>>> test_str_tuple(0)
b'a'
>>> test_mix_tuple(1)
b'abc'
>>> test_mix_tuple(0)
1
"""
import
sys
if
sys
.
version_info
[
0
]
<
3
:
__doc__
=
__doc__
.
replace
(
" b'"
,
" '"
)
else
:
__doc__
=
__doc__
.
replace
(
" u'"
,
" '"
)
def
test_str
(
n
):
return
"abcd"
[
n
]
def
test_unicode_ascii
(
n
):
return
u"abcd"
[
n
]
def
test_unicode
(
n
):
return
u"
\
u00fc
\
u00f6
\
u00e4
"
[
n
]
def
test_int_list
(
n
):
return
[
1
,
2
,
3
,
4
][
n
]
def
test_str_list
(
n
):
return
[
"a"
,
"bcd"
,
"efg"
,
"xyz"
][
n
]
def
test_int_tuple
(
n
):
return
(
1
,
2
,
3
,
4
)[
n
]
def
test_str_tuple
(
n
):
return
(
"a"
,
"bcd"
,
"efg"
,
"xyz"
)[
n
]
def
test_mix_tuple
(
n
):
return
(
1
,
"abc"
,
u"
\
u00fc
"
,
1.1
)[
n
]
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