[pypy-svn] r65710 - pypy/trunk/pypy/rpython/test
benjamin at codespeak.net
benjamin at codespeak.net
Wed Jun 10 05:26:17 CEST 2009
Author: benjamin
Date: Wed Jun 10 05:26:13 2009
New Revision: 65710
Modified:
pypy/trunk/pypy/rpython/test/test_rstr.py
Log:
test that the parameter can be optional
Modified: pypy/trunk/pypy/rpython/test/test_rstr.py
==============================================================================
--- pypy/trunk/pypy/rpython/test/test_rstr.py (original)
+++ pypy/trunk/pypy/rpython/test/test_rstr.py Wed Jun 10 05:26:13 2009
@@ -559,7 +559,11 @@
def f(i, newlines):
s = [const(''), const("\n"), const("\n\n"), const("hi\n"),
const("random data\r\n"), const("\r\n"), const("\rdata")]
- return len(s[i].splitlines(newlines))
+ test_string = s[i]
+ if newlines:
+ return len(test_string.splitlines(True))
+ else:
+ return len(test_string.splitlines())
for newlines in (True, False):
for i in xrange(5):
res = self.interpret(f, [i, newlines])
More information about the Pypy-commit
mailing list