| 524 | self.assertEqual(groups[3].results, matchedresult[2]) |
| 525 | |
| 526 | def test_nested_command_is_unknown(self): |
| 527 | cmd = "withargs -b arg unknown" |
| 528 | |
| 529 | matchedresult = [ |
| 530 | MR(0, 8, "withargs synopsis", "withargs"), |
| 531 | MR(9, 15, "-b <arg> desc", "-b arg"), |
| 532 | MR(16, 23, "FILE argument", "unknown"), |
| 533 | ] |
| 534 | |
| 535 | groups = matcher.Matcher(cmd, s).match() |
| 536 | self.assertEqual(len(groups), 2) |
| 537 | self.assertEqual(groups[0].results, []) |
| 538 | self.assertEqual(groups[1].results, matchedresult) |
| 539 | |
| 540 | def test_unparsed(self): |
| 541 | cmd = "(bar; bar) c" |