(t *testing.T)
| 119 | } |
| 120 | |
| 121 | func TestDefinition_Secrets(t *testing.T) { |
| 122 | composeFileURI := fmt.Sprintf("file:///%v", strings.TrimPrefix(filepath.ToSlash(filepath.Join(os.TempDir(), "compose.yaml")), "/")) |
| 123 | u := uri.URI(composeFileURI) |
| 124 | for _, tc := range secretReferenceTestCases { |
| 125 | doc := document.NewComposeDocument(document.NewDocumentManager(), u, 1, []byte(tc.content)) |
| 126 | params := protocol.DefinitionParams{ |
| 127 | TextDocumentPositionParams: protocol.TextDocumentPositionParams{ |
| 128 | TextDocument: protocol.TextDocumentIdentifier{URI: composeFileURI}, |
| 129 | Position: protocol.Position{Line: tc.line, Character: tc.character}, |
| 130 | }, |
| 131 | } |
| 132 | |
| 133 | t.Run(fmt.Sprintf("%v (Location)", tc.name), func(t *testing.T) { |
| 134 | locations, err := Definition(context.Background(), false, doc, ¶ms) |
| 135 | require.NoError(t, err) |
| 136 | require.Equal(t, tc.locations(composeFileURI), locations) |
| 137 | }) |
| 138 | |
| 139 | t.Run(fmt.Sprintf("%v (LocationLink)", tc.name), func(t *testing.T) { |
| 140 | links, err := Definition(context.Background(), true, doc, ¶ms) |
| 141 | require.NoError(t, err) |
| 142 | require.Equal(t, tc.links(composeFileURI), links) |
| 143 | }) |
| 144 | } |
| 145 | } |
| 146 | |
| 147 | func TestDefinition_Models(t *testing.T) { |
| 148 | composeFileURI := fmt.Sprintf("file:///%v", strings.TrimPrefix(filepath.ToSlash(filepath.Join(os.TempDir(), "compose.yaml")), "/")) |
nothing calls this directly
no test coverage detected