]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Test _split() method in test_unix_options().
authorGreg Ward <gward@python.net>
Thu, 22 Aug 2002 21:12:54 +0000 (21:12 +0000)
committerGreg Ward <gward@python.net>
Thu, 22 Aug 2002 21:12:54 +0000 (21:12 +0000)
Lib/test/test_textwrap.py

index d6bd47c31b7d34a5c053659a0bec6b01dd7a8fc3..838596d78fc9dafdbffb269d64c0bcc1eb4814d5 100644 (file)
@@ -191,6 +191,15 @@ What a mess!
                   "in its long form."]
         self.check_wrap(text, 42, expect)
 
+        # Again, all of the above can be deduced from _split().
+        text = "the -n option, or --dry-run or --dryrun"
+        result = self.wrapper._split(text)
+        expect = ["the", " ", "-n", " ", "option,", " ", "or", " ",
+                  "--dry-", "run", " ", "or", " ", "--dryrun"]
+        self.assertEquals(result, expect,
+                          "\nexpected %r\n"
+                          "but got  %r" % (expect, result))
+
     def test_split(self):
         # Ensure that the standard _split() method works as advertised
         # in the comments