MCPcopy Create free account
hub / github.com/compose-spec/compose-go / Test_transformBuild

Function Test_transformBuild

transform/build_test.go:27–59  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

25)
26
27func 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}

Callers

nothing calls this directly

Calls 2

NewPathFunction · 0.92
transformBuildFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…