Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
5edf827c
Commit
5edf827c
authored
Jun 07, 2017
by
Jonathan Eunice
Committed by
Serhiy Storchaka
Jun 07, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bpo-30591: Added test for textwrap backtracking. (#1988)
parent
6f46683a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
0 deletions
+11
-0
Lib/test/test_textwrap.py
Lib/test/test_textwrap.py
+11
-0
No files found.
Lib/test/test_textwrap.py
View file @
5edf827c
...
...
@@ -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
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment