MCPcopy
hub / github.com/idank/explainshell / test_comsub_as_arg

Method test_comsub_as_arg

tests/test_matcher.py:674–690  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

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"

Callers

nothing calls this directly

Calls 1

matchMethod · 0.95

Tested by

no test coverage detected