[pypy-svn] r13730 - pypy/dist/pypy/rpython/test
mwh at codespeak.net
mwh at codespeak.net
Thu Jun 23 18:45:01 CEST 2005
Author: mwh
Date: Thu Jun 23 18:45:01 2005
New Revision: 13730
Modified:
pypy/dist/pypy/rpython/test/test_rstr.py
Log:
more string formatting tests
(we don't handle non-tuples on the RHS, btw)
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 Thu Jun 23 18:45:01 2005
@@ -206,5 +206,22 @@
def percentX(i):
return "bing %x bang" % (i,)
- res = interpret(percentX, [23])
+ x_fn = make_interpreter(percentX, [0])
+
+ res = x_fn(23)
assert ''.join(res.chars) == 'bing 17 bang'
+
+ res = x_fn(-123)
+ assert ''.join(res.chars) == 'bing -7b bang'
+
+ def moreThanOne(s, d, x):
+ return "string: %s decimal: %d hex: %x" % (s, d, x)
+
+ m_fn = make_interpreter(moreThanOne, ['a', 2, 3])
+
+ args = 'a', 2, 3
+ res = m_fn(*args)
+ assert ''.join(res.chars) == moreThanOne(*args)
+
+
+
More information about the Pypy-commit
mailing list