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
f84485ab
Commit
f84485ab
authored
May 17, 2008
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test case for various string literals
parent
9eefda4b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
87 additions
and
0 deletions
+87
-0
tests/run/strliterals.pyx
tests/run/strliterals.pyx
+87
-0
No files found.
tests/run/strliterals.pyx
0 → 100644
View file @
f84485ab
__doc__
=
ur"""
>>> s1
b'abc\x11'
>>> len(s1)
4
>>> s2
b'abc\\x11'
>>> len(s2)
7
>>> s3
b'abc\\x11'
>>> len(s3)
7
>>> s4
b'abc\x11'
>>> len(s4)
4
>>> s5
b'abc\x11'
>>> len(s5)
4
>>> s6
b'abc\\x11'
>>> len(s6)
7
>>> s7
b'abc\\x11'
>>> len(s7)
7
>>> s8
b'abc\\x11'
>>> len(s8)
7
>>> u1
u'abc\x11'
>>> len(u1)
4
>>> u2
u'abc\x11'
>>> len(u2)
4
>>> u3
u'abc\\x11'
>>> len(u3)
7
>>> u4
u'abc\\x11'
>>> len(u4)
7
>>> u5
u'abc\\x11'
>>> len(u5)
7
"""
import
sys
if
sys
.
version_info
[
0
]
>=
3
:
__doc__
=
__doc__
.
replace
(
u" u'"
,
u" '"
)
else
:
__doc__
=
__doc__
.
replace
(
u" b'"
,
u" '"
)
s1
=
"abc
\
x11
"
s2
=
r"abc\x11"
s3
=
R"abc\x11"
s4
=
b"abc
\
x11
"
s5
=
B"abc
\
x11
"
s6
=
br"abc\x11"
s7
=
Br"abc\x11"
s8
=
bR"abc\x11"
u1
=
u"abc
\
x11
"
u2
=
U"abc
\
x11
"
u3
=
ur"abc\x11"
u4
=
Ur"abc\x11"
u5
=
uR"abc\x11"
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