MCPcopy Create free account
hub / github.com/docker/cli / TestUnknownGlobal

Function TestUnknownGlobal

e2e/cli-plugins/flags_test.go:126–144  ·  view source on GitHub ↗

TestUnknownGlobal checks that unknown globals report errors

(t *testing.T)

Source from the content-addressed store, hash-verified

124
125// TestUnknownGlobal checks that unknown globals report errors
126func TestUnknownGlobal(t *testing.T) {
127 run, _, cleanup := prepare(t)
128 defer cleanup()
129
130 for name, args := range map[string][]string{
131 "no-val": {"--unknown", "helloworld"},
132 "separate-val": {"--unknown", "foo", "helloworld"},
133 "joined-val": {"--unknown=foo", "helloworld"},
134 } {
135 t.Run(name, func(t *testing.T) {
136 res := icmd.RunCmd(run(args...))
137 res.Assert(t, icmd.Expected{
138 ExitCode: 125,
139 Out: icmd.None,
140 Err: "unknown flag: --unknown",
141 })
142 })
143 }
144}
145
146// TestCliPluginsVersion checks that `-v` and friends DTRT
147func TestCliPluginsVersion(t *testing.T) {

Callers

nothing calls this directly

Calls 2

prepareFunction · 0.85
runFunction · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…