diff options
| author | Paul Buetow <paul@buetow.org> | 2025-09-06 10:25:36 +0300 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2025-09-06 10:25:36 +0300 |
| commit | 5be9532cfa630f4aacd8d879c3e4f5cc316da0fa (patch) | |
| tree | 0a901680fccd1e2703ffdbd9284ccff932be1d67 /internal/lsp/handlers_helpers_test.go | |
| parent | 70f1d0e78c57dfa5beae779b3d392b6e6fa44c14 (diff) | |
feat(lsp): configurable inline/chat triggers; switch inline markers to >text>/>>text>; update docs and example config; tests updated to new triggers and raise LSP coverage to >=85%; chore: remove semicolon legacy; chore(mage): auto-refresh coverage daily if docs/coverage.out is older than 24h
Diffstat (limited to 'internal/lsp/handlers_helpers_test.go')
| -rw-r--r-- | internal/lsp/handlers_helpers_test.go | 56 |
1 files changed, 28 insertions, 28 deletions
diff --git a/internal/lsp/handlers_helpers_test.go b/internal/lsp/handlers_helpers_test.go index eb7f273..24a9690 100644 --- a/internal/lsp/handlers_helpers_test.go +++ b/internal/lsp/handlers_helpers_test.go @@ -6,32 +6,32 @@ import ( ) func TestHasDoubleSemicolonTrigger(t *testing.T) { - cases := []struct { - line string - want bool - }{ - {";;todo; remove this", true}, - {"prefix ;;x; suffix", true}, - {";; spaced ;", false}, - {"no markers", false}, - {";;x ; space before close", false}, - } - for _, tc := range cases { - got := hasDoubleSemicolonTrigger(tc.line) - if got != tc.want { - t.Fatalf("hasDoubleSemicolonTrigger(%q)=%v want %v", tc.line, got, tc.want) - } - } + cases := []struct { + line string + want bool + }{ + {">>todo> remove this", true}, + {"prefix >>x> suffix", true}, + {">> spaced >", false}, + {"no markers", false}, + {">>x > space before close", false}, + } + for _, tc := range cases { + got := hasDoubleOpenTrigger(tc.line) + if got != tc.want { + t.Fatalf("hasDoubleOpenTrigger(%q)=%v want %v", tc.line, got, tc.want) + } + } } func TestCollectSemicolonMarkers(t *testing.T) { - line := "keep ;ok; this and ;another; that" - edits := collectSemicolonMarkers(line, 7) - if len(edits) != 2 { - t.Fatalf("expected 2 edits, got %d", len(edits)) - } - // Validate the first edit aligns with ;ok; - start := strings.Index(line, ";ok;") + line := "keep >ok> this and >another> that" + edits := collectSemicolonMarkers(line, 7) + if len(edits) != 2 { + t.Fatalf("expected 2 edits, got %d", len(edits)) + } + // Validate the first edit aligns with ;ok; + start := strings.Index(line, ">ok>") if start < 0 { t.Fatalf("test setup: missing ;ok;") } @@ -41,11 +41,11 @@ func TestCollectSemicolonMarkers(t *testing.T) { } func TestPromptRemovalEditsForLine_WholeLine(t *testing.T) { - line := ";;todo; remove this whole line" - edits := promptRemovalEditsForLine(line, 3) - if len(edits) != 1 { - t.Fatalf("expected 1 whole-line edit, got %d", len(edits)) - } + line := ">>todo> remove this whole line" + edits := promptRemovalEditsForLine(line, 3) + if len(edits) != 1 { + t.Fatalf("expected 1 whole-line edit, got %d", len(edits)) + } e := edits[0] if e.Range.Start.Line != 3 || e.Range.End.Line != 3 || e.Range.Start.Character != 0 || e.Range.End.Character != len(line) { t.Fatalf("unexpected range for whole-line removal: %+v", e.Range) |
