summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_descr.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_descr.py')
-rw-r--r--Lib/test/test_descr.py27
1 files changed, 25 insertions, 2 deletions
diff --git a/Lib/test/test_descr.py b/Lib/test/test_descr.py
index 11a3a5d..a29eb23 100644
--- a/Lib/test/test_descr.py
+++ b/Lib/test/test_descr.py
@@ -1481,9 +1481,32 @@ def inherits():
verify(str(s) == "12345")
verify(str(s).__class__ is str)
- s = madstring("\x00" * 5)
- verify(str(s) == "\x00" * 5)
+ base = "\x00" * 5
+ s = madstring(base)
+ verify(str(s) == base)
verify(str(s).__class__ is str)
+ verify((s + "").__class__ is str)
+ verify(("" + s).__class__ is str)
+ verify((s * 0).__class__ is str)
+ verify((s * 1).__class__ is str)
+ verify((s * 2).__class__ is str)
+ verify(s[:].__class__ is str)
+ verify(s[0:0].__class__ is str)
+ verify(s.strip().__class__ is str)
+ identitytab = ''.join([chr(i) for i in range(256)])
+ verify(s.translate(identitytab).__class__ is str)
+ verify(s.translate(identitytab) == base)
+ verify(s.translate(identitytab, "x").__class__ is str)
+ verify(s.translate(identitytab, "x") == base)
+ verify(s.translate(identitytab, "\x00") == "")
+ verify(s.replace("x", "x").__class__ is str)
+ verify(s.replace("x", "x") == base)
+ verify(s.ljust(len(s)).__class__ is str)
+ verify(s.ljust(len(s)) == base)
+ verify(s.rjust(len(s)).__class__ is str)
+ verify(s.rjust(len(s)) == base)
+ verify(s.center(len(s)).__class__ is str)
+ verify(s.center(len(s)) == base)
class madunicode(unicode):
_rev = None