(t *testing.T)
| 67 | } |
| 68 | |
| 69 | func TestDefinition_Volumes(t *testing.T) { |
| 70 | composeFileURI := fmt.Sprintf("file:///%v", strings.TrimPrefix(filepath.ToSlash(filepath.Join(os.TempDir(), "compose.yaml")), "/")) |
| 71 | u := uri.URI(composeFileURI) |
| 72 | for _, tc := range volumeReferenceTestCases { |
| 73 | doc := document.NewComposeDocument(document.NewDocumentManager(), u, 1, []byte(tc.content)) |
| 74 | params := protocol.DefinitionParams{ |
| 75 | TextDocumentPositionParams: protocol.TextDocumentPositionParams{ |
| 76 | TextDocument: protocol.TextDocumentIdentifier{URI: composeFileURI}, |
| 77 | Position: protocol.Position{Line: tc.line, Character: tc.character}, |
| 78 | }, |
| 79 | } |
| 80 | |
| 81 | t.Run(fmt.Sprintf("%v (Location)", tc.name), func(t *testing.T) { |
| 82 | locations, err := Definition(context.Background(), false, doc, ¶ms) |
| 83 | require.NoError(t, err) |
| 84 | require.Equal(t, tc.locations(composeFileURI), locations) |
| 85 | }) |
| 86 | |
| 87 | t.Run(fmt.Sprintf("%v (LocationLink)", tc.name), func(t *testing.T) { |
| 88 | links, err := Definition(context.Background(), true, doc, ¶ms) |
| 89 | require.NoError(t, err) |
| 90 | require.Equal(t, tc.links(composeFileURI), links) |
| 91 | }) |
| 92 | } |
| 93 | } |
| 94 | |
| 95 | func TestDefinition_Configs(t *testing.T) { |
| 96 | composeFileURI := fmt.Sprintf("file:///%v", strings.TrimPrefix(filepath.ToSlash(filepath.Join(os.TempDir(), "compose.yaml")), "/")) |
nothing calls this directly
no test coverage detected