summaryrefslogtreecommitdiff
path: root/internal/lsp/codeaction_gotest_int_test.go
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2025-09-08 12:02:40 +0300
committerPaul Buetow <paul@buetow.org>2025-09-08 12:02:40 +0300
commit75cf6abd55bfb60324fc47cf91eac08dbb8b87b4 (patch)
tree6ef90d8014fe4d9a757d3f7e95bf736b70e4c685 /internal/lsp/codeaction_gotest_int_test.go
parent0dcf347c3fbc6e4ffb7e46294f5dd92dbbcd98ef (diff)
docs: move tmux documentation to its own file
Diffstat (limited to 'internal/lsp/codeaction_gotest_int_test.go')
-rw-r--r--internal/lsp/codeaction_gotest_int_test.go37
1 files changed, 18 insertions, 19 deletions
diff --git a/internal/lsp/codeaction_gotest_int_test.go b/internal/lsp/codeaction_gotest_int_test.go
index 6bb1c45..04a73e0 100644
--- a/internal/lsp/codeaction_gotest_int_test.go
+++ b/internal/lsp/codeaction_gotest_int_test.go
@@ -1,26 +1,25 @@
package lsp
import (
- "os"
- "path/filepath"
- "testing"
+ "os"
+ "path/filepath"
+ "testing"
)
func TestResolveGoTest_CreatesTestFile(t *testing.T) {
- dir := t.TempDir()
- src := filepath.Join(dir, "x.go")
- if err := os.WriteFile(src, []byte("package x\n\nfunc Sum(a,b int) int { return a+b }\n"), 0o644); err != nil {
- t.Fatalf("write: %v", err)
- }
- s := &Server{} // minimal server with nil llmClient to trigger stub
- uri := "file://" + src
- we, jumpURI, jumpRange, ok := s.resolveGoTest(uri, Position{Line: 2})
- if !ok || jumpURI == "" || jumpRange.Start.Line < 0 {
- t.Fatalf("resolveGoTest failed: ok=%v uri=%q range=%v", ok, jumpURI, jumpRange)
- }
- // Expect documentChanges to include a create and an edit
- if len(we.DocumentChanges) == 0 && len(we.Changes) == 0 {
- t.Fatalf("expected edits to create or append test file: %+v", we)
- }
+ dir := t.TempDir()
+ src := filepath.Join(dir, "x.go")
+ if err := os.WriteFile(src, []byte("package x\n\nfunc Sum(a,b int) int { return a+b }\n"), 0o644); err != nil {
+ t.Fatalf("write: %v", err)
+ }
+ s := &Server{} // minimal server with nil llmClient to trigger stub
+ uri := "file://" + src
+ we, jumpURI, jumpRange, ok := s.resolveGoTest(uri, Position{Line: 2})
+ if !ok || jumpURI == "" || jumpRange.Start.Line < 0 {
+ t.Fatalf("resolveGoTest failed: ok=%v uri=%q range=%v", ok, jumpURI, jumpRange)
+ }
+ // Expect documentChanges to include a create and an edit
+ if len(we.DocumentChanges) == 0 && len(we.Changes) == 0 {
+ t.Fatalf("expected edits to create or append test file: %+v", we)
+ }
}
-