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

Method test_multiple_positionals_variadic

tests/test_matcher.py:88–98  ·  view source on GitHub ↗

extra args beyond the defined positionals reuse the last one; adjacent matches with the same text get merged

(self)

Source from the content-addressed store, hash-verified

86 self.assertMatchSingle(cmd, s.find_man_page("withmultipos")[0], matchedresult)
87
88 def test_multiple_positionals_variadic(self):
89 """extra args beyond the defined positionals reuse the last one;
90 adjacent matches with the same text get merged"""
91 cmd = "withmultipos a b c"
92 matchedresult = [
93 MR(0, 12, "withmultipos synopsis", "withmultipos"),
94 MR(13, 14, "source file(s) to copy", "a"),
95 MR(15, 18, "destination path", "b c"), # b and c merged
96 ]
97
98 self.assertMatchSingle(cmd, s.find_man_page("withmultipos")[0], matchedresult)
99
100 def test_positional_name_match(self):
101 """a word that exactly matches a positional key uses that key's text"""

Callers

nothing calls this directly

Calls 2

assertMatchSingleMethod · 0.95
find_man_pageMethod · 0.45

Tested by

no test coverage detected