Author: Brian Kearns <bdkea...@gmail.com> Branch: Changeset: r74809:0961d3cfbdde Date: 2014-12-04 02:09 -0500 http://bitbucket.org/pypy/pypy/changeset/0961d3cfbdde/
Log: test any/all in test_zjit 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 @@ -277,21 +277,45 @@ def define_any(): return """ - a = [0,0,0,0,0,0,0,0,0,0,0] - a[8] = -12 - b = a + a - any(b) + a = [0,0,0,0,0,0,0,1,0,0,0] + any(a) """ def test_any(self): result = self.run("any") assert result == 1 - py.test.skip("don't run for now") - self.check_simple_loop({"raw_load": 2, "float_add": 1, - "int_and": 1, "int_add": 1, - 'cast_float_to_int': 1, - "int_ge": 1, "jump": 1, - "guard_false": 2, 'arraylen_gc': 1}) + self.check_trace_count(1) + self.check_simple_loop({ + 'cast_float_to_int': 1, + 'guard_false': 2, + 'guard_not_invalidated': 1, + 'int_add': 2, + 'int_and': 1, + 'int_ge': 1, + 'jump': 1, + 'raw_load': 1, + }) + + def define_all(): + return """ + a = [1,1,1,1,1,1,1,1] + all(a) + """ + + def test_all(self): + result = self.run("all") + assert result == 1 + self.check_simple_loop({ + 'cast_float_to_int': 1, + 'guard_false': 1, + 'guard_not_invalidated': 1, + 'guard_true': 1, + 'int_add': 2, + 'int_and': 1, + 'int_ge': 1, + 'jump': 1, + 'raw_load': 1, + }) def define_already_forced(): return """ _______________________________________________ pypy-commit mailing list pypy-commit@python.org https://mail.python.org/mailman/listinfo/pypy-commit