[pypy-commit] pypy numppy-flatitter: add iter test, more to come

mattip noreply at buildbot.pypy.org
Fri Jan 27 00:32:48 CET 2012


Author: mattip
Branch: numppy-flatitter
Changeset: r51840:fc5fe1efe542
Date: 2012-01-19 11:37 +0200
http://bitbucket.org/pypy/pypy/changeset/fc5fe1efe542/

Log:	add iter test, more to come

diff --git a/pypy/module/micronumpy/test/test_iter.py b/pypy/module/micronumpy/test/test_iter.py
new file mode 100644
--- /dev/null
+++ b/pypy/module/micronumpy/test/test_iter.py
@@ -0,0 +1,12 @@
+import py
+from pypy.module.micronumpy.interp_iter import ViewIterator
+
+class TestIterDirect(object):
+    def test_viewiterator(self):
+        i = ViewIterator(0, [5, 1], [10, 4], [3, 5])
+        i = i.next(2)
+        i = i.next(2)
+        i = i.next(2)
+        assert i.offset == 3
+        assert not i.done()
+        assert i.indices == [0,3]


More information about the pypy-commit mailing list