MCPcopy Create free account
hub / github.com/ajitpratap0/GoSQLX / TestFunctional_Hover_UnknownWord

Function TestFunctional_Hover_UnknownWord

pkg/lsp/handler_functional_test.go:209–230  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

207}
208
209func TestFunctional_Hover_UnknownWord(t *testing.T) {
210 mock := newMockReadWriter()
211 logger := log.New(io.Discard, "", 0)
212 server := NewServer(mock.input, mock.output, logger)
213
214 server.Documents().Open("file:///test.sql", "sql", 1, "SELECT xyzzy FROM users")
215
216 params := TextDocumentPositionParams{
217 TextDocument: TextDocumentIdentifier{URI: "file:///test.sql"},
218 Position: Position{Line: 0, Character: 8}, // inside "xyzzy"
219 }
220 raw, _ := json.Marshal(params)
221 result, err := server.handler.HandleRequest("textDocument/hover", raw)
222 if err != nil {
223 t.Fatal(err)
224 }
225
226 hover := result.(*Hover)
227 if hover.Contents.Value != "" {
228 t.Error("expected empty hover for unknown word")
229 }
230}
231
232// ---------------------------------------------------------------------------
233// Initialize

Callers

nothing calls this directly

Calls 6

DocumentsMethod · 0.95
newMockReadWriterFunction · 0.85
NewServerFunction · 0.85
OpenMethod · 0.80
HandleRequestMethod · 0.80
ErrorMethod · 0.45

Tested by

no test coverage detected