[pypy-svn] r13863 - in pypy/dist/pypy/rpython: . test
ale at codespeak.net
ale at codespeak.net
Sat Jun 25 16:59:19 CEST 2005
Author: ale
Date: Sat Jun 25 16:59:18 2005
New Revision: 13863
Modified:
pypy/dist/pypy/rpython/rbuiltin.py
pypy/dist/pypy/rpython/test/test_rbuiltin.py
Log:
builtin max done
Modified: pypy/dist/pypy/rpython/rbuiltin.py
==============================================================================
--- pypy/dist/pypy/rpython/rbuiltin.py (original)
+++ pypy/dist/pypy/rpython/rbuiltin.py Sat Jun 25 16:59:18 2005
@@ -147,7 +147,7 @@
assert isinstance(rint2, IntegerRepr)
assert rint1.lowleveltype == rint2.lowleveltype
v1, v2 = hop.inputargs(rint1, rint2)
- return hop.gendirectcall(ll_min, v1, v2)
+ return hop.gendirectcall(ll_max, v1, v2)
def ll_max(i1, i2):
if i1 > i2:
Modified: pypy/dist/pypy/rpython/test/test_rbuiltin.py
==============================================================================
--- pypy/dist/pypy/rpython/test/test_rbuiltin.py (original)
+++ pypy/dist/pypy/rpython/test/test_rbuiltin.py Sat Jun 25 16:59:18 2005
@@ -1,4 +1,5 @@
from pypy.rpython.test.test_llinterp import interpret, make_interpreter
+
from pypy.annotation.builtin import *
import py
@@ -31,11 +32,11 @@
assert ev_fun(2, 2) == 2
assert ev_fun(-1, -12) == -12
-def test_int_min():
+def test_int_max():
def fn(i, j):
- return min(i,j)
+ return max(i,j)
ev_fun = make_interpreter(fn, [0, 0])
- assert ev_fun(1, 2) == 1
- assert ev_fun(1, -1) == -1
+ assert ev_fun(1, 2) == 2
+ assert ev_fun(1, -1) == 1
assert ev_fun(2, 2) == 2
- assert ev_fun(-1, -12) == -12
+ assert ev_fun(-1, -12) == -1
More information about the Pypy-commit
mailing list