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
5a80280d
Commit
5a80280d
authored
Jun 27, 2012
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added array.array tests for buffer interface and memory views
parent
473cc0be
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
3 deletions
+29
-3
tests/run/pyarray.pyx
tests/run/pyarray.pyx
+29
-3
No files found.
tests/run/pyarray.pyx
View file @
5a80280d
...
...
@@ -105,13 +105,39 @@ def test_resize(a):
assert
cb
.
length
==
10
assert
cb
[
9
]
==
cb
[
-
1
]
==
cb
.
_f
[
9
]
==
9
def
test_buffer
():
"""
>>> test_buffer()
"""
cdef
object
a
=
array
.
array
(
'i'
,
[
1
,
2
,
3
])
cdef
object
[
int
]
ca
=
a
assert
ca
[
0
]
==
1
assert
ca
[
2
]
==
3
def
test_buffer_typed
():
"""
>>> test_buffer_typed()
"""
cdef
array
.
array
a
=
array
.
array
(
'i'
,
[
1
,
2
,
3
])
cdef
object
[
int
]
ca
=
a
assert
ca
[
0
]
==
1
assert
ca
[
2
]
==
3
def
test_view
():
"""
>>> a = array.array('f', [1.0, 2.0, 3.0])
>>> test_view()
"""
a
=
array
.
array
(
'i'
,
[
1
,
2
,
3
])
cdef
object
[
int
]
ca
=
a
cdef
object
a
=
array
.
array
(
'i'
,
[
1
,
2
,
3
])
cdef
int
[:]
ca
=
a
assert
ca
[
0
]
==
1
assert
ca
[
2
]
==
3
def
test_view_typed
():
"""
>>> test_view_typed()
"""
cdef
array
.
array
a
=
array
.
array
(
'i'
,
[
1
,
2
,
3
])
cdef
int
[:]
ca
=
a
assert
ca
[
0
]
==
1
assert
ca
[
2
]
==
3
...
...
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