MCPcopy Index your code
hub / github.com/idank/explainshell / test_procsub

Method test_procsub

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

Source from the content-addressed store, hash-verified

702 self.assertEqual(m.expansions, [(2, 3, "substitution")])
703
704 def test_procsub(self):
705 cmd = "withargs -b <(a) >(b)"
706
707 matchedresult = [
708 MR(0, 8, "withargs synopsis", "withargs"),
709 MR(9, 16, "-b <arg> desc", "-b <(a)"),
710 MR(17, 21, "FILE argument", ">(b)"),
711 ]
712
713 m = matcher.Matcher(cmd, s)
714 groups = m.match()
715 self.assertEqual(groups[0].results, [])
716 self.assertEqual(groups[1].results, matchedresult)
717
718 # check expansions
719 self.assertEqual(
720 m.expansions, [(14, 15, "substitution"), (19, 20, "substitution")]
721 )
722
723 def test_if(self):
724 cmd = "if bar -a; then b; fi"

Callers

nothing calls this directly

Calls 1

matchMethod · 0.95

Tested by

no test coverage detected