(t *testing.T)
| 19 | } |
| 20 | |
| 21 | func 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 | |
| 52 | func TestPluginMatch(t *testing.T) { |
| 53 | testCases := []struct { |
nothing calls this directly
no test coverage detected
searching dependent graphs…