Commit c6d0a5c8 authored by Stefan Behnel's avatar Stefan Behnel

Add a test for code presented in github issue #1857. (Does not test for leaks.)

parent bf0c9758
...@@ -878,4 +878,24 @@ def test_dispatch_ndim(ndim_t array): ...@@ -878,4 +878,24 @@ def test_dispatch_ndim(ndim_t array):
""" """
print cython.typeof(array), np.asarray(array).ndim print cython.typeof(array), np.asarray(array).ndim
@testcase
def test_copy_buffer(np.ndarray[double, ndim=1] a):
"""
>>> a = test_copy_buffer(np.ones(10, dtype=np.double))
>>> len(a)
10
>>> print(a.dtype)
float64
>>> a[0]
1.0
"""
a = a.copy()
a = a.copy()
a = a.copy()
a = a.copy()
a = a.copy()
return a
include "numpy_common.pxi" include "numpy_common.pxi"
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment