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
Boxiang Sun
cython
Commits
c7a06feb
Commit
c7a06feb
authored
Oct 18, 2009
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Py3 test fixes
parent
1f83af96
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
69 additions
and
39 deletions
+69
-39
tests/run/for_in_range_T372.pyx
tests/run/for_in_range_T372.pyx
+25
-8
tests/run/jarausch1.pyx
tests/run/jarausch1.pyx
+11
-3
tests/run/kostyrka2.pyx
tests/run/kostyrka2.pyx
+1
-5
tests/run/literalslice.pyx
tests/run/literalslice.pyx
+5
-8
tests/run/r_vree_1.pyx
tests/run/r_vree_1.pyx
+15
-3
tests/run/unicodeliterals.pyx
tests/run/unicodeliterals.pyx
+4
-4
tests/run/unicodeliteralsdefault.pyx
tests/run/unicodeliteralsdefault.pyx
+4
-4
tests/run/unicodeliteralslatin1.pyx
tests/run/unicodeliteralslatin1.pyx
+4
-4
No files found.
tests/run/for_in_range_T372.pyx
View file @
c7a06feb
__doc__
=
u"""
__doc__
=
u"""
>>> test_modify()
>>> test_modify()
0 1 2 3 4
0
1
2
3
4
<BLANKLINE>
(4, 0)
(4, 0)
>>> test_fix()
>>> test_fix()
0 1 2 3 4
0
1
2
3
4
<BLANKLINE>
4
4
>>> test_break()
>>> test_break()
0 1 2
0
1
2
<BLANKLINE>
(2, 0)
(2, 0)
>>> test_return()
>>> test_return()
0 1 2
0
1
2
(2, 0)
(2, 0)
"""
"""
...
@@ -20,7 +35,7 @@ cimport cython
...
@@ -20,7 +35,7 @@ cimport cython
def
test_modify
():
def
test_modify
():
cdef
int
i
,
n
=
5
cdef
int
i
,
n
=
5
for
i
in
range
(
n
):
for
i
in
range
(
n
):
print
i
,
print
i
n
=
0
n
=
0
print
print
return
i
,
n
return
i
,
n
...
@@ -30,7 +45,7 @@ def test_modify():
...
@@ -30,7 +45,7 @@ def test_modify():
def
test_fix
():
def
test_fix
():
cdef
int
i
cdef
int
i
for
i
in
range
(
5
):
for
i
in
range
(
5
):
print
i
,
print
i
print
print
return
i
return
i
...
@@ -39,10 +54,12 @@ def test_fix():
...
@@ -39,10 +54,12 @@ def test_fix():
def
test_break
():
def
test_break
():
cdef
int
i
,
n
=
5
cdef
int
i
,
n
=
5
for
i
in
range
(
n
):
for
i
in
range
(
n
):
print
i
,
print
i
n
=
0
n
=
0
if
i
==
2
:
if
i
==
2
:
break
break
else
:
print
"FAILED!"
print
print
return
i
,
n
return
i
,
n
...
@@ -51,7 +68,7 @@ def test_break():
...
@@ -51,7 +68,7 @@ def test_break():
def
test_return
():
def
test_return
():
cdef
int
i
,
n
=
5
cdef
int
i
,
n
=
5
for
i
in
range
(
n
):
for
i
in
range
(
n
):
print
i
,
print
i
n
=
0
n
=
0
if
i
==
2
:
if
i
==
2
:
return
i
,
n
return
i
,
n
...
...
tests/run/jarausch1.pyx
View file @
c7a06feb
__doc__
=
u"""
__doc__
=
u"""
>>> py_x = br'
\
\
\
\
'
>>> b == br'
\
\
\
\
'
>>> assert x == py_x
True
>>> s == r'
\
\
\
\
'
True
>>> u == ur'
\
\
\
\
'
True
"""
"""
import
sys
import
sys
if
sys
.
version_info
[
0
]
<
3
:
if
sys
.
version_info
[
0
]
<
3
:
__doc__
=
__doc__
.
replace
(
u" br'"
,
u" r'"
)
__doc__
=
__doc__
.
replace
(
u" br'"
,
u" r'"
)
else
:
__doc__
=
__doc__
.
replace
(
u" ur'"
,
u" r'"
)
x
=
r'\\'
b
=
br'\\'
s
=
r'\\'
u
=
ur'\\'
tests/run/kostyrka2.pyx
View file @
c7a06feb
__doc__
=
u"""
__doc__
=
u"""
>>> x = X()
>>> x = X()
>>> x.slots
>>> x.slots
[
b
'']
['']
"""
"""
import
sys
if
sys
.
version_info
[
0
]
<
3
:
__doc__
=
__doc__
.
replace
(
u"b'"
,
u"'"
)
class
X
:
class
X
:
slots
=
[
""
,
]
slots
=
[
""
,
]
tests/run/literalslice.pyx
View file @
c7a06feb
__doc__
=
u"""
__doc__
=
u"""
>>> test_str(1)
>>> test_str(1)
b
'b'
'b'
>>> test_unicode_ascii(2)
>>> test_unicode_ascii(2)
u'c'
u'c'
...
@@ -10,14 +10,14 @@ __doc__ = u"""
...
@@ -10,14 +10,14 @@ __doc__ = u"""
>>> test_int_list(2)
>>> test_int_list(2)
3
3
>>> test_str_list(1)
>>> test_str_list(1)
b
'bcd'
'bcd'
>>> test_int_tuple(2)
>>> test_int_tuple(2)
3
3
>>> test_str_tuple(0)
>>> test_str_tuple(0)
b
'a'
'a'
>>> test_mix_tuple(1)
>>> test_mix_tuple(1)
b
'abc'
'abc'
>>> test_mix_tuple(0)
>>> test_mix_tuple(0)
1
1
"""
"""
...
@@ -30,10 +30,7 @@ else:
...
@@ -30,10 +30,7 @@ else:
__doc__
=
__doc__
.
replace
(
u" b'"
,
u" '"
)
__doc__
=
__doc__
.
replace
(
u" b'"
,
u" '"
)
def
test_str
(
n
):
def
test_str
(
n
):
if
IS_PY3
:
return
"abcd"
[
n
]
return
bytes
([
"abcd"
[
n
]])
else
:
return
"abcd"
[
n
]
def
test_unicode_ascii
(
n
):
def
test_unicode_ascii
(
n
):
return
u"abcd"
[
n
]
return
u"abcd"
[
n
]
...
...
tests/run/r_vree_1.pyx
View file @
c7a06feb
__doc__
=
"""# disabled in Py3
import
sys
if
sys
.
version_info
[
0
]
<
3
:
__doc__
=
u"""
>>> test(0)
>>> test(0)
0L
0L
>>> test(1)
>>> test(1)
1L
1L
>>> import sys
>>> sys.maxint + 1 > sys.maxint
>>> sys.maxint + 1 > sys.maxint
True
True
>>> type(sys.maxint * 2 + 1) is long
>>> type(sys.maxint * 2 + 1) is long
...
@@ -19,7 +22,16 @@ __doc__ = """# disabled in Py3
...
@@ -19,7 +22,16 @@ __doc__ = """# disabled in Py3
True
True
>>> test(256 ** unsigned_long_size() - 1) > sys.maxint
>>> test(256 ** unsigned_long_size() - 1) > sys.maxint
True
True
"""
"""
else
:
__doc__
=
u"""
>>> test(0)
0
>>> test(1)
1
>>> test(256 ** unsigned_long_size() - 1) > 0
True
"""
def
test
(
k
):
def
test
(
k
):
cdef
unsigned
long
m
cdef
unsigned
long
m
...
...
tests/run/unicodeliterals.pyx
View file @
c7a06feb
# -*- coding: utf-8 -*-
# -*- coding: utf-8 -*-
__doc__
=
r"""
__doc__
=
b
r"""
>>> sa
>>> sa
b
'abc'
'abc'
>>> ua
>>> ua
u'abc'
u'abc'
>>> b
>>> b
...
@@ -19,7 +19,7 @@ __doc__ = r"""
...
@@ -19,7 +19,7 @@ __doc__ = r"""
u'S\xf8k ik\xfc\xd6\xe4abc'
u'S\xf8k ik\xfc\xd6\xe4abc'
>>> null
>>> null
u'\x00'
u'\x00'
"""
.
decode
(
u"ASCII"
)
+
"""
"""
.
decode
(
"ASCII"
)
+
b
"""
>>> len(sa)
>>> len(sa)
3
3
>>> len(ua)
>>> len(ua)
...
@@ -38,7 +38,7 @@ __doc__ = r"""
...
@@ -38,7 +38,7 @@ __doc__ = r"""
12
12
>>> len(null)
>>> len(null)
1
1
"""
.
decode
(
u
"ASCII"
)
+
u"""
"""
.
decode
(
"ASCII"
)
+
u"""
>>> ua == u'abc'
>>> ua == u'abc'
True
True
>>> b == u'123'
>>> b == u'123'
...
...
tests/run/unicodeliteralsdefault.pyx
View file @
c7a06feb
...
@@ -6,9 +6,9 @@
...
@@ -6,9 +6,9 @@
# This file is written in UTF-8, but it has no encoding declaration,
# This file is written in UTF-8, but it has no encoding declaration,
# so it just defaults to UTF-8 (PEP 3120).
# so it just defaults to UTF-8 (PEP 3120).
__doc__
=
r"""
__doc__
=
b
r"""
>>> sa
>>> sa
b
'abc'
'abc'
>>> ua
>>> ua
u'abc'
u'abc'
>>> b
>>> b
...
@@ -25,7 +25,7 @@ __doc__ = r"""
...
@@ -25,7 +25,7 @@ __doc__ = r"""
u'S\xf8k ik\xfc\xd6\xe4abc'
u'S\xf8k ik\xfc\xd6\xe4abc'
>>> null
>>> null
u'\x00'
u'\x00'
"""
.
decode
(
u"ASCII"
)
+
"""
"""
.
decode
(
"ASCII"
)
+
b
"""
>>> len(sa)
>>> len(sa)
3
3
>>> len(ua)
>>> len(ua)
...
@@ -44,7 +44,7 @@ __doc__ = r"""
...
@@ -44,7 +44,7 @@ __doc__ = r"""
12
12
>>> len(null)
>>> len(null)
1
1
"""
.
decode
(
u
"ASCII"
)
+
u"""
"""
.
decode
(
"ASCII"
)
+
u"""
>>> ua == u'abc'
>>> ua == u'abc'
True
True
>>> b == u'123'
>>> b == u'123'
...
...
tests/run/unicodeliteralslatin1.pyx
View file @
c7a06feb
# -*- coding: latin-1 -*-
# -*- coding: latin-1 -*-
__doc__
=
r"""
__doc__
=
b
r"""
>>> sa
>>> sa
b
'abc'
'abc'
>>> ua
>>> ua
u'abc'
u'abc'
>>> b
>>> b
...
@@ -19,7 +19,7 @@ __doc__ = r"""
...
@@ -19,7 +19,7 @@ __doc__ = r"""
u'S\xf8k ik\xfc\xd6\xe4abc'
u'S\xf8k ik\xfc\xd6\xe4abc'
>>> null
>>> null
u'\x00'
u'\x00'
"""
.
decode
(
u"ASCII"
)
+
"""
"""
.
decode
(
"ASCII"
)
+
b
"""
>>> len(sa)
>>> len(sa)
3
3
>>> len(ua)
>>> len(ua)
...
@@ -38,7 +38,7 @@ __doc__ = r"""
...
@@ -38,7 +38,7 @@ __doc__ = r"""
12
12
>>> len(null)
>>> len(null)
1
1
"""
.
decode
(
u
"ASCII"
)
+
u"""
"""
.
decode
(
"ASCII"
)
+
u"""
>>> ua == u'abc'
>>> ua == u'abc'
True
True
>>> b == u'123'
>>> b == u'123'
...
...
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