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
Kirill Smelkov
cython
Commits
ded26a8c
Commit
ded26a8c
authored
May 20, 2012
by
Robert Bradshaw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
More Py3 test fixes.
parent
c7a7c577
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
10 deletions
+10
-10
tests/run/pyarray.pyx
tests/run/pyarray.pyx
+10
-10
No files found.
tests/run/pyarray.pyx
View file @
ded26a8c
...
...
@@ -117,13 +117,12 @@ def test_view():
def
test_extend
():
"""
>>> a = array.array('f', [1.0, 2.0, 3.0])
>>> test_extend()
"""
cdef
array
.
array
ca
=
array
.
array
(
'i'
,
[
1
,
2
,
3
])
cdef
array
.
array
cb
=
array
.
array
(
'i'
,
range
(
4
,
6
)
)
cdef
array
.
array
cb
=
array
.
array
(
'i'
,
[
4
,
5
]
)
array
.
extend
(
ca
,
cb
)
assert
list
(
ca
)
==
range
(
1
,
6
)
,
list
(
ca
)
assert
list
(
ca
)
==
[
1
,
2
,
3
,
4
,
5
]
,
list
(
ca
)
def
test_likes
(
a
):
"""
...
...
@@ -138,14 +137,15 @@ def test_likes(a):
def
test_extend_buffer
():
"""
>>> a = array.array('f', [1.0, 2.0, 3.0])
>>> test_extend_buffer()
array('
c', 'abcdefghij'
)
array('
l', [15, 37, 389, 5077]
)
"""
cdef
array
.
array
ca
=
array
.
array
(
'c'
,
"abcdef"
)
cdef
char
*
s
=
"ghij"
array
.
extend_buffer
(
ca
,
s
,
len
(
s
))
# or use stdlib.strlen
cdef
array
.
array
ca
=
array
.
array
(
'l'
,
[
15
,
37
])
cdef
long
[
2
]
s
s
[
0
]
=
389
s
[
1
]
=
5077
array
.
extend_buffer
(
ca
,
<
char
*>
&
s
,
2
)
assert
ca
.
_
c
[
9
]
==
'j'
assert
len
(
ca
)
==
10
assert
ca
.
_
L
[
3
]
==
5077
assert
len
(
ca
)
==
4
return
ca
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