[pypy-commit] pypy numppy-flatitter: an absolutely crucial test

fijal noreply at buildbot.pypy.org
Fri Jan 27 11:20:18 CET 2012


Author: Maciej Fijalkowski <fijall at gmail.com>
Branch: numppy-flatitter
Changeset: r51845:93ed7361747f
Date: 2012-01-27 12:19 +0200
http://bitbucket.org/pypy/pypy/changeset/93ed7361747f/

Log:	an absolutely crucial test

diff --git a/pypy/module/micronumpy/compile.py b/pypy/module/micronumpy/compile.py
--- a/pypy/module/micronumpy/compile.py
+++ b/pypy/module/micronumpy/compile.py
@@ -32,7 +32,8 @@
 class BadToken(Exception):
     pass
 
-SINGLE_ARG_FUNCTIONS = ["sum", "prod", "max", "min", "all", "any", "unegative", "flat"]
+SINGLE_ARG_FUNCTIONS = ["sum", "prod", "max", "min", "all", "any",
+                        "unegative", "flat"]
 
 class FakeSpace(object):
     w_ValueError = None
diff --git a/pypy/module/micronumpy/test/test_compile.py b/pypy/module/micronumpy/test/test_compile.py
--- a/pypy/module/micronumpy/test/test_compile.py
+++ b/pypy/module/micronumpy/test/test_compile.py
@@ -245,3 +245,11 @@
         a -> 3
         """)
         assert interp.results[0].value == 11
+
+    def test_flat_iter(self):
+        interp = self.run('''
+        a = |30|
+        b = flat(a)
+        b -> 3
+        ''')
+        assert interp.results[0].value == 3
diff --git a/pypy/module/micronumpy/test/test_zjit.py b/pypy/module/micronumpy/test/test_zjit.py
--- a/pypy/module/micronumpy/test/test_zjit.py
+++ b/pypy/module/micronumpy/test/test_zjit.py
@@ -372,12 +372,13 @@
     def define_flat_iter():
         return '''
         a = |30|
-        flat(a)
+        b = flat(a)
+        b -> 3
         '''
 
     def test_flat_iter(self):
         result = self.run("flat_iter")
-        assert result == 0
+        assert result == 3
 
     def define_flat_getitem():
         return '''


More information about the pypy-commit mailing list