| 672 | ) |
| 673 | |
| 674 | def test_comsub_as_arg(self): |
| 675 | cmd = "withargs $(a) $0" |
| 676 | |
| 677 | matchedresult = [ |
| 678 | MR(0, 8, "withargs synopsis", "withargs"), |
| 679 | MR(9, 16, "FILE argument", "$(a) $0"), |
| 680 | ] |
| 681 | |
| 682 | m = matcher.Matcher(cmd, s) |
| 683 | groups = m.match() |
| 684 | self.assertEqual(groups[0].results, []) |
| 685 | self.assertEqual(groups[1].results, matchedresult) |
| 686 | |
| 687 | # check expansions |
| 688 | self.assertEqual( |
| 689 | m.expansions, [(11, 12, "substitution"), (14, 16, "parameter-digits")] |
| 690 | ) |
| 691 | |
| 692 | def test_comsub_as_first_word(self): |
| 693 | cmd = "$(a) b" |