diff options
author | Guido van Rossum <guido@python.org> | 2007-11-06 21:34:58 +0000 |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 2007-11-06 21:34:58 +0000 |
commit | 98297ee7815939b124156e438b22bd652d67b5db (patch) | |
tree | a9d239ebd87c73af2571ab48003984c4e18e27e5 /Lib/test/string_tests.py | |
parent | a19f80c6df2df5e8a5d0cff37131097835ef971e (diff) | |
download | cpython-git-98297ee7815939b124156e438b22bd652d67b5db.tar.gz |
Merging the py3k-pep3137 branch back into the py3k branch.
No detailed change log; just check out the change log for the py3k-pep3137
branch. The most obvious changes:
- str8 renamed to bytes (PyString at the C level);
- bytes renamed to buffer (PyBytes at the C level);
- PyString and PyUnicode are no longer compatible.
I.e. we now have an immutable bytes type and a mutable bytes type.
The behavior of PyString was modified quite a bit, to make it more
bytes-like. Some changes are still on the to-do list.
Diffstat (limited to 'Lib/test/string_tests.py')
-rw-r--r-- | Lib/test/string_tests.py | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/Lib/test/string_tests.py b/Lib/test/string_tests.py index 9da062ea58..a789515fb3 100644 --- a/Lib/test/string_tests.py +++ b/Lib/test/string_tests.py @@ -558,10 +558,10 @@ class CommonTest(BaseTest): a = self.type2test('DNSSEC') b = self.type2test('') for c in a: - # Special case for the str8, since indexing returns a integer - # XXX Maybe it would be a good idea to seperate str8's tests... - if self.type2test == str8: - c = chr(c) +## # Special case for the str8, since indexing returns a integer +## # XXX Maybe it would be a good idea to seperate str8's tests... +## if self.type2test == str8: +## c = chr(c) b += c hash(b) self.assertEqual(hash(a), hash(b)) @@ -992,14 +992,14 @@ class MixinStrUnicodeUserStringTest: self.checkequal('abc', 'a', 'join', ('abc',)) self.checkequal('z', 'a', 'join', UserList(['z'])) self.checkequal('a.b.c', '.', 'join', ['a', 'b', 'c']) - self.checkequal('a.b.3', '.', 'join', ['a', 'b', 3]) + self.assertRaises(TypeError, '.'.join, ['a', 'b', 3]) for i in [5, 25, 125]: self.checkequal(((('a' * i) + '-') * i)[:-1], '-', 'join', ['a' * i] * i) self.checkequal(((('a' * i) + '-') * i)[:-1], '-', 'join', ('a' * i,) * i) - self.checkequal(str(BadSeq1()), ' ', 'join', BadSeq1()) + #self.checkequal(str(BadSeq1()), ' ', 'join', BadSeq1()) self.checkequal('a b c', ' ', 'join', BadSeq2()) self.checkraises(TypeError, ' ', 'join') @@ -1147,16 +1147,16 @@ class MixinStrUnicodeTest: s2 = "".join([s1]) self.assert_(s1 is s2) - elif t is str8: - s1 = subclass("abcd") - s2 = "".join([s1]) - self.assert_(s1 is not s2) - self.assert_(type(s2) is str) # promotes! +## elif t is str8: +## s1 = subclass("abcd") +## s2 = "".join([s1]) +## self.assert_(s1 is not s2) +## self.assert_(type(s2) is str) # promotes! - s1 = t("abcd") - s2 = "".join([s1]) - self.assert_(s1 is not s2) - self.assert_(type(s2) is str) # promotes! +## s1 = t("abcd") +## s2 = "".join([s1]) +## self.assert_(s1 is not s2) +## self.assert_(type(s2) is str) # promotes! else: self.fail("unexpected type for MixinStrUnicodeTest %r" % t) |