mirror of
https://github.com/python/cpython.git
synced 2025-12-11 19:40:17 +00:00
Add test_unix_options() to WrapTestCase to test for SF bug #596434.
This commit is contained in:
parent
cce4d67fc4
commit
34f995b3c1
1 changed files with 28 additions and 0 deletions
|
|
@ -163,6 +163,34 @@ What a mess!
|
||||||
"\nexpected %r\n"
|
"\nexpected %r\n"
|
||||||
"but got %r" % (expect, result))
|
"but got %r" % (expect, result))
|
||||||
|
|
||||||
|
def test_unix_options (self):
|
||||||
|
# Test that Unix-style command-line options are wrapped correctly.
|
||||||
|
# Both Optik (OptionParser) and Docutils rely on this behaviour!
|
||||||
|
|
||||||
|
text = "You should use the -n option, or --dry-run in its long form."
|
||||||
|
self.check_wrap(text, 20,
|
||||||
|
["You should use the",
|
||||||
|
"-n option, or --dry-",
|
||||||
|
"run in its long",
|
||||||
|
"form."])
|
||||||
|
self.check_wrap(text, 21,
|
||||||
|
["You should use the -n",
|
||||||
|
"option, or --dry-run",
|
||||||
|
"in its long form."])
|
||||||
|
expect = ["You should use the -n option, or",
|
||||||
|
"--dry-run in its long form."]
|
||||||
|
self.check_wrap(text, 32, expect)
|
||||||
|
self.check_wrap(text, 34, expect)
|
||||||
|
self.check_wrap(text, 35, expect)
|
||||||
|
self.check_wrap(text, 38, expect)
|
||||||
|
expect = ["You should use the -n option, or --dry-",
|
||||||
|
"run in its long form."]
|
||||||
|
self.check_wrap(text, 39, expect)
|
||||||
|
self.check_wrap(text, 41, expect)
|
||||||
|
expect = ["You should use the -n option, or --dry-run",
|
||||||
|
"in its long form."]
|
||||||
|
self.check_wrap(text, 42, expect)
|
||||||
|
|
||||||
def test_split(self):
|
def test_split(self):
|
||||||
# Ensure that the standard _split() method works as advertised
|
# Ensure that the standard _split() method works as advertised
|
||||||
# in the comments
|
# in the comments
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue