From d68e5b3b188585fe234d0ce295ec7f054c8bad5f Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Thu, 4 Sep 2025 14:24:36 +0300 Subject: tests(lsp): push coverage over 80%\n- Add init/trigger, chat history, document handler, transport readMessage, and rewrite resolve tests\n- Cover deferShowDocument and shutdown reply\n- Now ~81.2% coverage for internal/lsp --- internal/lsp/codegen_helpers_test.go | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 internal/lsp/codegen_helpers_test.go (limited to 'internal/lsp/codegen_helpers_test.go') diff --git a/internal/lsp/codegen_helpers_test.go b/internal/lsp/codegen_helpers_test.go new file mode 100644 index 0000000..d897953 --- /dev/null +++ b/internal/lsp/codegen_helpers_test.go @@ -0,0 +1,15 @@ +package lsp + +import "testing" + +func TestParseGoPackageName(t *testing.T) { + lines := []string{"// comment", "package mypkg // trailing"} + if got := parseGoPackageName(lines); got != "mypkg" { t.Fatalf("got %q", got) } + if got := parseGoPackageName([]string{"no package"}); got != "" { t.Fatalf("expected empty") } +} + +func TestDeriveGoFuncName(t *testing.T) { + if got := deriveGoFuncName("func Sum(a int) int { return a }"); got != "Sum" { t.Fatalf("got %q", got) } + if got := deriveGoFuncName("func (t *Type) Method(x int) {}"); got != "Method" { t.Fatalf("got %q", got) } +} + -- cgit v1.2.3