(t *testing.T)
| 92 | } |
| 93 | |
| 94 | func TestGetDecoder(t *testing.T) { |
| 95 | testCases := []struct { |
| 96 | name string |
| 97 | content string |
| 98 | }{ |
| 99 | { |
| 100 | name: "target {}", |
| 101 | content: "target {}", |
| 102 | }, |
| 103 | } |
| 104 | |
| 105 | for _, tc := range testCases { |
| 106 | t.Run(tc.name, func(t *testing.T) { |
| 107 | opts := WithReadDocumentFunc(func(uri.URI) ([]byte, error) { |
| 108 | return []byte(tc.content), nil |
| 109 | }) |
| 110 | mgr := NewDocumentManager(opts) |
| 111 | document, err := mgr.Read(context.Background(), "docker-bake.hcl") |
| 112 | require.Nil(t, err) |
| 113 | |
| 114 | hclDocument, ok := document.(BakeHCLDocument) |
| 115 | require.True(t, ok) |
| 116 | require.NotNil(t, hclDocument.Decoder()) |
| 117 | }) |
| 118 | } |
| 119 | } |
| 120 | |
| 121 | func TestDocumentPath(t *testing.T) { |
| 122 | testCases := []struct { |
nothing calls this directly
no test coverage detected