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
d6575834
Commit
d6575834
authored
Dec 30, 2008
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Py3 test case fix
parent
0ce2d9e1
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
8 deletions
+12
-8
tests/run/set.pyx
tests/run/set.pyx
+12
-8
No files found.
tests/run/set.pyx
View file @
d6575834
...
@@ -2,12 +2,12 @@ __doc__ = u"""
...
@@ -2,12 +2,12 @@ __doc__ = u"""
>>> type(test_set_literal()) is _set
>>> type(test_set_literal()) is _set
True
True
>>> sorted(test_set_literal())
>>> sorted(test_set_literal())
[
'a',
'b', 1]
[
u'a', u
'b', 1]
>>> type(test_set_add()) is _set
>>> type(test_set_add()) is _set
True
True
>>> sorted(test_set_add())
>>> sorted(test_set_add())
['a', 1]
[
u
'a', 1]
>>> type(test_set_list_comp()) is _set
>>> type(test_set_list_comp()) is _set
True
True
...
@@ -27,21 +27,25 @@ True
...
@@ -27,21 +27,25 @@ True
>>> type(test_set_discard()) is _set
>>> type(test_set_discard()) is _set
True
True
>>> sorted(test_set_discard())
>>> sorted(test_set_discard())
['12', 233]
[
u
'12', 233]
"""
"""
import
sys
if
sys
.
version_info
[
0
]
>=
3
:
__doc__
=
__doc__
.
replace
(
u"u'"
,
u"'"
).
replace
(
u'u"'
,
u'"'
)
# Py2.3 doesn't have the 'set' builtin type, but Cython does :)
# Py2.3 doesn't have the 'set' builtin type, but Cython does :)
_set
=
set
_set
=
set
def
test_set_literal
():
def
test_set_literal
():
cdef
set
s1
=
{
1
,
'a'
,
1
,
'b'
,
'a'
}
cdef
set
s1
=
{
1
,
u'a'
,
1
,
u'b'
,
u
'a'
}
return
s1
return
s1
def
test_set_add
():
def
test_set_add
():
cdef
set
s1
cdef
set
s1
s1
=
set
([
1
])
s1
=
set
([
1
])
s1
.
add
(
1
)
s1
.
add
(
1
)
s1
.
add
(
'a'
)
s1
.
add
(
u
'a'
)
s1
.
add
(
1
)
s1
.
add
(
1
)
return
s1
return
s1
...
@@ -59,17 +63,17 @@ def test_set_list_comp():
...
@@ -59,17 +63,17 @@ def test_set_list_comp():
def
test_set_pop
():
def
test_set_pop
():
cdef
set
s1
cdef
set
s1
s1
=
set
()
s1
=
set
()
s1
.
add
(
'2'
)
s1
.
add
(
u
'2'
)
two
=
s1
.
pop
()
two
=
s1
.
pop
()
return
s1
return
s1
def
test_set_discard
():
def
test_set_discard
():
cdef
set
s1
cdef
set
s1
s1
=
set
()
s1
=
set
()
s1
.
add
(
'12'
)
s1
.
add
(
u
'12'
)
s1
.
add
(
3
)
s1
.
add
(
3
)
s1
.
add
(
233
)
s1
.
add
(
233
)
s1
.
discard
(
'3'
)
s1
.
discard
(
u
'3'
)
s1
.
discard
(
3
)
s1
.
discard
(
3
)
return
s1
return
s1
...
...
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