summaryrefslogtreecommitdiff
path: root/internal/lsp/prefix_table_test.go
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2025-09-06 10:56:27 +0300
committerPaul Buetow <paul@buetow.org>2025-09-06 10:56:27 +0300
commit320de746f7a2985b60c8564a0e65bdf231e840b7 (patch)
treee70bcf50813dba411afa2934e774383124bbc99e /internal/lsp/prefix_table_test.go
parent06247527d5170f329b454b42f59a3e4434ab1f4b (diff)
use gofumpt
Diffstat (limited to 'internal/lsp/prefix_table_test.go')
-rw-r--r--internal/lsp/prefix_table_test.go35
1 files changed, 17 insertions, 18 deletions
diff --git a/internal/lsp/prefix_table_test.go b/internal/lsp/prefix_table_test.go
index 0ca23d2..d362927 100644
--- a/internal/lsp/prefix_table_test.go
+++ b/internal/lsp/prefix_table_test.go
@@ -3,22 +3,21 @@ package lsp
import "testing"
func TestPrefixStripping_Table(t *testing.T) {
- cases := []struct{ name, prefix, sugg, want string }{
- {"assign_walrus", "name := ", "name := compute()", "compute()"},
- {"assign_equals", "x = ", "x = y+1", "y+1"},
- {"general_db", "db.", "db.Query()", "Query()"},
- {"general_func", "func New ", "func New() *T", "() *T"},
- }
- for _, c := range cases {
- var got string
- if c.name == "assign_walrus" || c.name == "assign_equals" {
- got = stripDuplicateAssignmentPrefix(c.prefix, c.sugg)
- } else {
- got = stripDuplicateGeneralPrefix(c.prefix, c.sugg)
- }
- if got != c.want {
- t.Fatalf("%s: got %q want %q", c.name, got, c.want)
- }
- }
+ cases := []struct{ name, prefix, sugg, want string }{
+ {"assign_walrus", "name := ", "name := compute()", "compute()"},
+ {"assign_equals", "x = ", "x = y+1", "y+1"},
+ {"general_db", "db.", "db.Query()", "Query()"},
+ {"general_func", "func New ", "func New() *T", "() *T"},
+ }
+ for _, c := range cases {
+ var got string
+ if c.name == "assign_walrus" || c.name == "assign_equals" {
+ got = stripDuplicateAssignmentPrefix(c.prefix, c.sugg)
+ } else {
+ got = stripDuplicateGeneralPrefix(c.prefix, c.sugg)
+ }
+ if got != c.want {
+ t.Fatalf("%s: got %q want %q", c.name, got, c.want)
+ }
+ }
}
-