vendor tsgo

This commit is contained in:
2026-07-09 16:50:43 -04:00
parent c06ea2e5a4
commit 98978e4930
5804 changed files with 1556156 additions and 101 deletions

View File

@@ -0,0 +1,24 @@
package core
import "testing"
func TestPatternOverlappingMatch(t *testing.T) {
t.Parallel()
p := TryParsePattern("ab*ab")
if p.Matches("ab") {
t.Errorf("expected 'ab' not to match 'ab*ab'")
}
if !p.Matches("abXab") {
t.Errorf("expected 'abXab' to match 'ab*ab'")
}
if got := p.MatchedText("abXab"); got != "X" {
t.Errorf("MatchedText = %q, want %q", got, "X")
}
if !p.Matches("abab") {
t.Errorf("expected 'abab' to match 'ab*ab'")
}
if got := p.MatchedText("abab"); got != "" {
t.Errorf("MatchedText = %q, want empty", got)
}
}