MCPcopy Create free account
hub / github.com/idank/explainshell / test_only_prefixed_positional

Method test_only_prefixed_positional

tests/test_matcher.py:167–184  ·  view source on GitHub ↗

a page whose only positional is prefixed: prefix token matches, non-prefix token goes unknown instead of raising on the empty pool

(self)

Source from the content-addressed store, hash-verified

165 self.assertMatchSingle(cmd, s.find_man_page("withprefixpos")[0], matchedresult)
166
167 def test_only_prefixed_positional(self):
168 """a page whose only positional is prefixed: prefix token matches,
169 non-prefix token goes unknown instead of raising on the empty pool"""
170 cmd = "onlyprefixpos :1"
171 matchedresult = [
172 MR(0, 13, "onlyprefixpos synopsis", "onlyprefixpos"),
173 MR(14, 16, "display to use", ":1"),
174 ]
175
176 self.assertMatchSingle(cmd, s.find_man_page("onlyprefixpos")[0], matchedresult)
177
178 cmd = "onlyprefixpos foo"
179 matchedresult = [
180 MR(0, 13, "onlyprefixpos synopsis", "onlyprefixpos"),
181 MR(14, 17, None, "foo"),
182 ]
183
184 self.assertMatchSingle(cmd, s.find_man_page("onlyprefixpos")[0], matchedresult)
185
186 def test_reset_current_option_if_argument_taken(self):
187 cmd = "withargs -ab12 arg"

Callers

nothing calls this directly

Calls 2

assertMatchSingleMethod · 0.95
find_man_pageMethod · 0.45

Tested by

no test coverage detected