diff options
Diffstat (limited to 'internal/lsp/handlers_test.go')
| -rw-r--r-- | internal/lsp/handlers_test.go | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/internal/lsp/handlers_test.go b/internal/lsp/handlers_test.go index 6803d1e..b2b47c0 100644 --- a/internal/lsp/handlers_test.go +++ b/internal/lsp/handlers_test.go @@ -16,7 +16,7 @@ func TestFindFirstInstructionInLine_NoMarker(t *testing.T) { } func TestFindFirstInstructionInLine_StrictInline_Basic(t *testing.T) { - line := "prefix >rename var> suffix" + line := "prefix >!rename var> suffix" s := newTestServer() instr, cleaned, ok := s.findFirstInstructionInLine(line) if !ok { @@ -32,7 +32,7 @@ func TestFindFirstInstructionInLine_StrictInline_Basic(t *testing.T) { } func TestFindFirstInstructionInLine_StrictInline_TrailingSpacesTrimmed(t *testing.T) { - line := "code>fix> \t\t" + line := "code>!fix> \t\t" s := newTestServer() instr, cleaned, ok := s.findFirstInstructionInLine(line) if !ok { @@ -48,9 +48,9 @@ func TestFindFirstInstructionInLine_StrictInline_TrailingSpacesTrimmed(t *testin func TestFindFirstInstructionInLine_Inline_InvalidPatterns(t *testing.T) { cases := []string{ - "prefix > bad> suffix", // space after first '>' ⇒ invalid - "prefix >bad > suffix", // space before closing '>' ⇒ invalid - "prefix > > suffix", // empty inner ⇒ invalid + "prefix >! bad> suffix", // space after '!' + "prefix >!bad > suffix", // space before closing '>' ⇒ invalid + "prefix >! > suffix", // empty inner ⇒ invalid } for _, line := range cases { s := newTestServer() @@ -136,14 +136,14 @@ func TestFindFirstInstructionInLine_DoubleDash(t *testing.T) { } func TestFindFirstInstructionInLine_EarliestWins_CommentOverInline(t *testing.T) { - line := "aa // comment >not this> trailing" + line := "aa // comment >!not this> trailing" s := newTestServer() instr, cleaned, ok := s.findFirstInstructionInLine(line) if !ok { t.Fatalf("expected ok=true") } - if instr != "comment >not this> trailing" { - t.Fatalf("instr got %q want %q", instr, "comment >not this> trailing") + if instr != "comment >!not this> trailing" { + t.Fatalf("instr got %q want %q", instr, "comment >!not this> trailing") } if cleaned != "aa" { t.Fatalf("cleaned got %q want %q", cleaned, "aa") @@ -151,7 +151,7 @@ func TestFindFirstInstructionInLine_EarliestWins_CommentOverInline(t *testing.T) } func TestFindFirstInstructionInLine_EarliestWins_InlineOverComment(t *testing.T) { - line := "aa >short> // comment" + line := "aa >!short> // comment" s := newTestServer() instr, cleaned, ok := s.findFirstInstructionInLine(line) if !ok { @@ -168,19 +168,19 @@ func TestFindFirstInstructionInLine_EarliestWins_InlineOverComment(t *testing.T) func TestFindStrictInlineTag_Various(t *testing.T) { // basic - if text, l, r, ok := findStrictInlineTag("pre>do it>post", '>', '>'); !ok || text != "do it" || l != 3 || r != 10 { + if text, l, r, ok := findStrictInlineTag("pre>!do it>post", ">!", '>', '>'); !ok || text != "do it" || l != 3 || r != 11 { t.Fatalf("unexpected: ok=%v text=%q l=%d r=%d", ok, text, l, r) } // at start - if text, l, r, ok := findStrictInlineTag(">x>", '>', '>'); !ok || text != "x" || l != 0 || r != 3 { + if text, l, r, ok := findStrictInlineTag(">!x>", ">!", '>', '>'); !ok || text != "x" || l != 0 || r != 4 { t.Fatalf("unexpected at start: ok=%v text=%q l=%d r=%d", ok, text, l, r) } - // double opening '>>' should still allow a tag starting at the second '>' - if text, _, _, ok := findStrictInlineTag("prefix >>bad> suffix", '>', '>'); !ok || text != "bad" { + // double opening '>>!' should still allow a tag starting after the double marker when configured for '>!' + if text, _, _, ok := findStrictInlineTag("prefix >>!bad> suffix", ">!", '>', '>'); !ok || text != "bad" { t.Fatalf("unexpected double-open handling: ok=%v text=%q", ok, text) } // inner spaces directly after first '>' or before last '>' invalidate the tag - if _, _, _, ok := findStrictInlineTag("a> inner >b", '>', '>'); ok { + if _, _, _, ok := findStrictInlineTag("a>! inner >b", ">!", '>', '>'); ok { t.Fatalf("expected invalid strict tag due to spaces at boundaries") } } |
