(t *testing.T)
| 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")), "/")) |
| 97 | u := uri.URI(composeFileURI) |
| 98 | for _, tc := range configReferenceTestCases { |
| 99 | doc := document.NewComposeDocument(document.NewDocumentManager(), u, 1, []byte(tc.content)) |
| 100 | params := protocol.DefinitionParams{ |
| 101 | TextDocumentPositionParams: protocol.TextDocumentPositionParams{ |
| 102 | TextDocument: protocol.TextDocumentIdentifier{URI: composeFileURI}, |
| 103 | Position: protocol.Position{Line: tc.line, Character: tc.character}, |
| 104 | }, |
| 105 | } |
| 106 | |
| 107 | t.Run(fmt.Sprintf("%v (Location)", tc.name), func(t *testing.T) { |
| 108 | locations, err := Definition(context.Background(), false, doc, ¶ms) |
| 109 | require.NoError(t, err) |
| 110 | require.Equal(t, tc.locations(composeFileURI), locations) |
| 111 | }) |
| 112 | |
| 113 | t.Run(fmt.Sprintf("%v (LocationLink)", tc.name), func(t *testing.T) { |
| 114 | links, err := Definition(context.Background(), true, doc, ¶ms) |
| 115 | require.NoError(t, err) |
| 116 | require.Equal(t, tc.links(composeFileURI), links) |
| 117 | }) |
| 118 | } |
| 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")), "/")) |
nothing calls this directly
no test coverage detected