(t *testing.T)
| 115 | } |
| 116 | |
| 117 | func TestRename_Models(t *testing.T) { |
| 118 | composeFileURI := fmt.Sprintf("file:///%v", strings.TrimPrefix(filepath.ToSlash(filepath.Join(os.TempDir(), "compose.yaml")), "/")) |
| 119 | u := uri.URI(composeFileURI) |
| 120 | for _, tc := range modelReferenceTestCases { |
| 121 | t.Run(tc.name, func(t *testing.T) { |
| 122 | doc := document.NewComposeDocument(document.NewDocumentManager(), u, 1, []byte(tc.content)) |
| 123 | edits, err := Rename(doc, &protocol.RenameParams{ |
| 124 | TextDocumentPositionParams: protocol.TextDocumentPositionParams{ |
| 125 | TextDocument: protocol.TextDocumentIdentifier{URI: composeFileURI}, |
| 126 | Position: protocol.Position{Line: tc.line, Character: tc.character}, |
| 127 | }, |
| 128 | NewName: "newName", |
| 129 | }) |
| 130 | require.NoError(t, err) |
| 131 | require.Equal(t, tc.renameEdits(composeFileURI), edits) |
| 132 | }) |
| 133 | } |
| 134 | } |
| 135 | |
| 136 | func TestRename_Fragments(t *testing.T) { |
| 137 | composeFileURI := fmt.Sprintf("file:///%v", strings.TrimPrefix(filepath.ToSlash(filepath.Join(os.TempDir(), "compose.yaml")), "/")) |
nothing calls this directly
no test coverage detected