MCPcopy Create free account
hub / github.com/Thunder-Compute/thunder-cli / pflagError

Function pflagError

cmd/root_test.go:227–240  ·  view source on GitHub ↗
(t *testing.T, arg string)

Source from the content-addressed store, hash-verified

225}
226
227func pflagError(t *testing.T, arg string) error {
228 t.Helper()
229
230 flags := pflag.NewFlagSet("test", pflag.ContinueOnError)
231 flags.SetOutput(io.Discard)
232 flags.String("name", "", "name")
233 flags.Int("count", 0, "count")
234
235 err := flags.Parse([]string{arg})
236 if err == nil {
237 t.Fatalf("expected pflag.Parse(%q) to fail", arg)
238 }
239 return err
240}
241
242func rootFlagError(t *testing.T, arg string) error {
243 t.Helper()

Callers 1

rootFlagErrorFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected