summaryrefslogtreecommitdiff
path: root/internal/lsp/context_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/lsp/context_test.go')
-rw-r--r--internal/lsp/context_test.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/internal/lsp/context_test.go b/internal/lsp/context_test.go
index 875eec9..fd555cf 100644
--- a/internal/lsp/context_test.go
+++ b/internal/lsp/context_test.go
@@ -61,6 +61,14 @@ func TestBuildAdditionalContext_AlwaysFull(t *testing.T) {
}
}
+func TestBuildAdditionalContext_UnknownModeFallsBackToMinimal(t *testing.T) {
+ s := newTestServer()
+ s.cfg.ContextMode = "unknown-mode"
+ if ctx, ok := s.buildAdditionalContext(false, "file:///x.go", Position{}); ok || ctx != "" {
+ t.Fatalf("expected no context for unknown mode; got ok=%v ctx=%q", ok, ctx)
+ }
+}
+
func TestTruncateToApproxTokens(t *testing.T) {
text := strings.Repeat("abcd", 10) // 40 chars
got := truncateToApproxTokens(text, 5) // ~20 chars