Kaydet (Commit) 5edf827c authored tarafından Jonathan Eunice's avatar Jonathan Eunice Kaydeden (comit) Serhiy Storchaka

bpo-30591: Added test for textwrap backtracking. (#1988)

üst 6f46683a
......@@ -559,6 +559,17 @@ class MaxLinesTestCase(BaseTestCase):
placeholder=' [truncated]...')
self.check_wrap(self.text, 80, [self.text], placeholder='.' * 1000)
def test_placeholder_backtrack(self):
# Test special case when max_lines insufficient, but what
# would be last wrapped line so long the placeholder cannot
# be added there without violence. So, textwrap backtracks,
# adding placeholder to the penultimate line.
text = 'Good grief Python features are advancing quickly!'
self.check_wrap(text, 12,
['Good grief', 'Python*****'],
max_lines=3,
placeholder='*****')
class LongWordTestCase (BaseTestCase):
def setUp(self):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment