[pypy-svn] r13947 - in pypy/dist/pypy/rpython: . test

tismer at codespeak.net tismer at codespeak.net
Sun Jun 26 15:11:21 CEST 2005


Author: tismer
Date: Sun Jun 26 15:11:20 2005
New Revision: 13947

Modified:
   pypy/dist/pypy/rpython/rstr.py
   pypy/dist/pypy/rpython/test/test_rstr.py
Log:
completed char mul, char inplace mul

Modified: pypy/dist/pypy/rpython/rstr.py
==============================================================================
--- pypy/dist/pypy/rpython/rstr.py	(original)
+++ pypy/dist/pypy/rpython/rstr.py	Sun Jun 26 15:11:20 2005
@@ -314,6 +314,7 @@
     def rtype_mul(_, hop):
         v_char, v_int = hop.inputargs(char_repr, Signed)
         return hop.gendirectcall(ll_char_mul, v_char, v_int)
+    rtype_inplace_mul = rtype_mul
 
 class __extend__(pairtype(CharRepr, CharRepr)):
     def rtype_eq(_, hop): return _rtype_compare_template(hop, 'eq')

Modified: pypy/dist/pypy/rpython/test/test_rstr.py
==============================================================================
--- pypy/dist/pypy/rpython/test/test_rstr.py	(original)
+++ pypy/dist/pypy/rpython/test/test_rstr.py	Sun Jun 26 15:11:20 2005
@@ -96,9 +96,14 @@
         res = 0
         for i in range(len(s)):
             res = res*10 + ord(s[i]) - ord('0')
+        c2 = c
+        c2 *= mul
+        res = 10 * res + (c2 == s)
         return res
     res = interpret(fn, ['3', 5])
-    assert res == 33333
+    assert res == 333331
+    res = interpret(fn, ['5', 3])
+    assert res == 5551
 
 def test_str_compare():
     def fn(i, j):



More information about the Pypy-commit mailing list