mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
When expandtabs() would be a no-op, don't create a duplicate string
This commit is contained in:
parent
87a484caf5
commit
e19aa388e8
2 changed files with 11 additions and 0 deletions
|
@ -1585,6 +1585,10 @@ class UnicodeTest(string_tests.CommonTest,
|
|||
return
|
||||
self.assertRaises(OverflowError, 't\tt\t'.expandtabs, sys.maxsize)
|
||||
|
||||
def test_expandtabs_optimization(self):
|
||||
s = 'abc'
|
||||
self.assertIs(s.expandtabs(), s)
|
||||
|
||||
def test_raiseMemError(self):
|
||||
if struct.calcsize('P') == 8:
|
||||
# 64 bits pointers
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue