diff options
| author | Paul Buetow <paul@buetow.org> | 2025-09-04 09:01:05 +0300 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2025-09-04 09:01:05 +0300 |
| commit | 218550d556f34920471e7360ad5e7f66ac76a0b6 (patch) | |
| tree | 6ab1b64b59a895e835af66cada209c3de59a8c81 /internal/lsp | |
| parent | ba2e2a14edb310fc03b6a8e0e809af50474a4ecf (diff) | |
tests(lsp): add more helper and code action tests; coverage trending upward
Diffstat (limited to 'internal/lsp')
| -rw-r--r-- | internal/lsp/helpers_more_test.go | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/internal/lsp/helpers_more_test.go b/internal/lsp/helpers_more_test.go index d4a3de6..64631f7 100644 --- a/internal/lsp/helpers_more_test.go +++ b/internal/lsp/helpers_more_test.go @@ -93,3 +93,15 @@ func TestIsBareDoubleSemicolon(t *testing.T) { if !isBareDoubleSemicolon(";; ") { t.Fatalf("expected true") } if isBareDoubleSemicolon(";;x;") { t.Fatalf("expected false for content form") } } + +func TestIsDefiningNewFunction(t *testing.T) { + s := newTestServer() + uri := "file:///z.go" + s.setDocument(uri, "package p\n\nfunc add(a int) int\n{") + if !s.isDefiningNewFunction(uri, Position{Line:2, Character:10}) { + t.Fatalf("expected true before opening brace") + } + if s.isDefiningNewFunction(uri, Position{Line:3, Character:1}) { + t.Fatalf("expected false inside body") + } +} |
