From bf53cf2a673af254d7a08bc3b2ab815a08f66117 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Thu, 4 Sep 2025 16:04:58 +0300 Subject: tests: add shared test fixtures, expand provider breadth (multi-choice, error bodies), add LSP rewrite/diagnostics realism and table-driven tests --- internal/lsp/completion_prefix_strip_test.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'internal/lsp/completion_prefix_strip_test.go') diff --git a/internal/lsp/completion_prefix_strip_test.go b/internal/lsp/completion_prefix_strip_test.go index 64cca49..99a08d6 100644 --- a/internal/lsp/completion_prefix_strip_test.go +++ b/internal/lsp/completion_prefix_strip_test.go @@ -1,8 +1,9 @@ package lsp import ( - "encoding/json" - "testing" + "encoding/json" + "testing" + tut "codeberg.org/snonux/hexai/internal/testutil" ) func TestStripDuplicateGeneralPrefix_ExactOverlap(t *testing.T) { @@ -40,7 +41,7 @@ func TestStripDuplicateAssignmentPrefix_AssignAndWalrus(t *testing.T) { func TestTryLLMCompletion_ManualInvokeAfterWhitespace_Allows(t *testing.T) { s := &Server{maxTokens: 32, triggerChars: []string{".", ":", "/", "_"}, compCache: make(map[string]string)} - s.llmClient = fakeLLM{resp: "() *CustData"} + s.llmClient = fakeLLM{resp: tut.MultilineFunctionSuggestion()} line := "func fib(i int) " // cursor after space p := CompletionParams{Position: Position{Line: 0, Character: len(line)}, TextDocument: TextDocumentIdentifier{URI: "file://x.go"}} // Simulate manual user invocation (TriggerKind=1) -- cgit v1.2.3