[pypy-svn] rev 2501 - pypy/trunk/src/pypy/objspace/std/test
guenter at codespeak.net
guenter at codespeak.net
Thu Dec 18 14:49:18 CET 2003
Author: guenter
Date: Thu Dec 18 14:49:18 2003
New Revision: 2501
Modified:
pypy/trunk/src/pypy/objspace/std/test/test_stringobject.py
Log:
test_translate added
Modified: pypy/trunk/src/pypy/objspace/std/test/test_stringobject.py
==============================================================================
--- pypy/trunk/src/pypy/objspace/std/test/test_stringobject.py (original)
+++ pypy/trunk/src/pypy/objspace/std/test/test_stringobject.py Thu Dec 18 14:49:18 2003
@@ -374,6 +374,13 @@
self.assertEquals("aaa AAA 111".swapcase(), "AAA aaa 111")
self.assertEquals("".swapcase(), "")
+ def test_translate(self):
+ import string
+ string.maketrans('ae','ea')
+ s="abcde"
+ self.assertEquals('ebcda', s.translate(string.maketrans('ea','ae')))
+ self.assertEquals('eda', s.translate(string.maketrans('ea','ae'),'bc'))
+
def test_iter(self):
l=[]
for i in iter("42"):
More information about the Pypy-commit
mailing list