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

Function TestGetNaiveFlags

cli-plugins/manager/hooks_test.go:21–50  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

19}
20
21func TestGetNaiveFlags(t *testing.T) {
22 testCases := []struct {
23 args []string
24 expectedFlags map[string]string
25 }{
26 {
27 args: []string{"docker"},
28 expectedFlags: map[string]string{},
29 },
30 {
31 args: []string{"docker", "build", "-q", "--file", "test.Dockerfile", "."},
32 expectedFlags: map[string]string{
33 "q": "",
34 "file": "",
35 },
36 },
37 {
38 args: []string{"docker", "--context", "a-context", "pull", "-q", "--progress", "auto", "alpine"},
39 expectedFlags: map[string]string{
40 "context": "",
41 "q": "",
42 "progress": "",
43 },
44 },
45 }
46
47 for _, tc := range testCases {
48 assert.DeepEqual(t, getNaiveFlags(tc.args), tc.expectedFlags)
49 }
50}
51
52func TestPluginMatch(t *testing.T) {
53 testCases := []struct {

Callers

nothing calls this directly

Calls 1

getNaiveFlagsFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…