Author: Mike Blume <[email protected]>
Branch: newindex
Changeset: r53751:b3eff16f15be
Date: 2012-03-14 15:22 -0700
http://bitbucket.org/pypy/pypy/changeset/b3eff16f15be/
Log: add simple (failing) tests for newindex
diff --git a/pypy/module/micronumpy/test/test_numarray.py
b/pypy/module/micronumpy/test/test_numarray.py
--- a/pypy/module/micronumpy/test/test_numarray.py
+++ b/pypy/module/micronumpy/test/test_numarray.py
@@ -374,6 +374,26 @@
assert a[1] == 0.
assert a[3] == 0.
+ def test_newindex(self):
+ from _numpypy import array
+ newindex = None
+ a = array(range(5))
+ b = array([range(5)])
+ assert (a[newindex] == b).all()
+
+ def test_newindex_slice(self):
+ from _numpypy import array
+ newindex = None
+
+ a = array(range(5))
+ b = array(range(1,5))
+ c = array([range(1,5)])
+ d = array([[x] for x in range(1,5)])
+
+ assert (a[1:] == b).all()
+ assert (a[1:,newindex] == d).all()
+ assert (a[newindex,1:] == c).all()
+
def test_scalar(self):
from _numpypy import array, dtype
a = array(3)
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit