(t *testing.T)
| 25 | ) |
| 26 | |
| 27 | func Test_transformBuild(t *testing.T) { |
| 28 | tests := []struct { |
| 29 | name string |
| 30 | yaml any |
| 31 | want any |
| 32 | }{ |
| 33 | { |
| 34 | name: "single context string", |
| 35 | yaml: "context_path", |
| 36 | want: map[string]any{ |
| 37 | "context": "context_path", |
| 38 | }, |
| 39 | }, |
| 40 | { |
| 41 | name: "mapping without context", |
| 42 | yaml: map[string]any{ |
| 43 | "dockerfile": "foo.Dockerfile", |
| 44 | }, |
| 45 | want: map[string]any{ |
| 46 | "dockerfile": "foo.Dockerfile", |
| 47 | }, |
| 48 | }, |
| 49 | } |
| 50 | for _, tt := range tests { |
| 51 | t.Run(tt.name, func(t *testing.T) { |
| 52 | got, err := transformBuild(tt.yaml, tree.NewPath("services.foo.build"), false) |
| 53 | assert.NilError(t, err) |
| 54 | if !reflect.DeepEqual(got, tt.want) { |
| 55 | t.Errorf("transformBuild() got = %v, want %v", got, tt.want) |
| 56 | } |
| 57 | }) |
| 58 | } |
| 59 | } |
nothing calls this directly
no test coverage detected
searching dependent graphs…