| 579 | self.assertEqual(groups[1].results, matchedresult[1]) |
| 580 | |
| 581 | def test_subshells(self): |
| 582 | cmd = "((bar); bar)" |
| 583 | matchedresult = [ |
| 584 | [ |
| 585 | MR(0, 2, help_constants._subshell, "(("), |
| 586 | MR(5, 6, help_constants._subshell, ")"), |
| 587 | MR(6, 7, help_constants.OPERATORS[";"], ";"), |
| 588 | MR(11, 12, help_constants._subshell, ")"), |
| 589 | ], |
| 590 | [MR(2, 5, "bar synopsis", "bar")], |
| 591 | [MR(8, 11, "bar synopsis", "bar")], |
| 592 | ] |
| 593 | |
| 594 | groups = matcher.Matcher(cmd, s).match() |
| 595 | self.assertEqual(groups[0].results, matchedresult[0]) |
| 596 | self.assertEqual(groups[1].results, matchedresult[1]) |
| 597 | self.assertEqual(groups[2].results, matchedresult[2]) |
| 598 | |
| 599 | def test_redirect_first_word_of_command(self): |
| 600 | cmd = "2>&1" |