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

Function TestIncrementalSync

pkg/lsp/server_test.go:520–546  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

518}
519
520func TestIncrementalSync(t *testing.T) {
521 mock := newMockReadWriter()
522 logger := log.New(io.Discard, "", 0)
523 server := NewServer(mock.input, mock.output, logger)
524
525 // Initialize and verify incremental sync is advertised
526 initParams := InitializeParams{
527 ProcessID: 1234,
528 RootURI: "file:///workspace",
529 Capabilities: ClientCapabilities{},
530 }
531
532 paramsJSON, _ := json.Marshal(initParams)
533 result, err := server.handler.HandleRequest("initialize", paramsJSON)
534 if err != nil {
535 t.Fatalf("initialize failed: %v", err)
536 }
537
538 initResult, ok := result.(*InitializeResult)
539 if !ok {
540 t.Fatalf("expected InitializeResult, got %T", result)
541 }
542
543 if initResult.Capabilities.TextDocumentSync.Change != SyncIncremental {
544 t.Errorf("expected SyncIncremental, got %v", initResult.Capabilities.TextDocumentSync.Change)
545 }
546}

Callers

nothing calls this directly

Calls 5

newMockReadWriterFunction · 0.85
NewServerFunction · 0.85
HandleRequestMethod · 0.80
FatalfMethod · 0.65
ErrorfMethod · 0.65

Tested by

no test coverage detected