diff options
author | Victor Stinner <vstinner@wyplay.com> | 2011-10-07 11:31:46 (GMT) |
---|---|---|
committer | Victor Stinner <vstinner@wyplay.com> | 2011-10-07 11:31:46 (GMT) |
commit | 1d972ad12abcac25bd7ce3482867794745b38f8a (patch) | |
tree | c3b80a571ee3602b71f0691fa815d77a03853186 /Lib/test | |
parent | ba7c226095703f63c78b00e56f1db8d99ac3a54a (diff) | |
download | cpython-1d972ad12abcac25bd7ce3482867794745b38f8a.zip cpython-1d972ad12abcac25bd7ce3482867794745b38f8a.tar.gz cpython-1d972ad12abcac25bd7ce3482867794745b38f8a.tar.bz2 |
Mark 'abc'.expandtab() optimization as specific to CPython
Improve also str.replace(a, a) test
Diffstat (limited to 'Lib/test')
-rw-r--r-- | Lib/test/test_unicode.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/Lib/test/test_unicode.py b/Lib/test/test_unicode.py index 14d3fa6..27df862 100644 --- a/Lib/test/test_unicode.py +++ b/Lib/test/test_unicode.py @@ -277,9 +277,9 @@ class UnicodeTest(string_tests.CommonTest, @support.cpython_only def test_replace_id(self): - a = 'a' # single ascii letters are singletons - text = 'abc' - self.assertIs(text.replace('a', 'a'), text) + pattern = 'abc' + text = 'abc def' + self.assertIs(text.replace(pattern, pattern), text) def test_bytes_comparison(self): with support.check_warnings(): @@ -1579,6 +1579,7 @@ class UnicodeTest(string_tests.CommonTest, return self.assertRaises(OverflowError, 't\tt\t'.expandtabs, sys.maxsize) + @support.cpython_only def test_expandtabs_optimization(self): s = 'abc' self.assertIs(s.expandtabs(), s) |