From 56fef7c8df2713261fbdbd396aa81ed23d9a945a Mon Sep 17 00:00:00 2001 From: Junegunn Choi Date: Mon, 13 Jan 2025 17:37:50 +0900 Subject: Simplify nth comparison when reusing transformed tokens --- src/pattern_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/pattern_test.go') diff --git a/src/pattern_test.go b/src/pattern_test.go index 1487d704..0f0632cd 100644 --- a/src/pattern_test.go +++ b/src/pattern_test.go @@ -68,7 +68,7 @@ func buildPattern(fuzzy bool, fuzzyAlgo algo.Algo, extended bool, caseMode Case, withPos bool, cacheable bool, nth []Range, delimiter Delimiter, runes []rune) *Pattern { return BuildPattern(NewChunkCache(), make(map[string]*Pattern), fuzzy, fuzzyAlgo, extended, caseMode, normalize, forward, - withPos, cacheable, nth, delimiter, runes) + withPos, cacheable, nth, delimiter, 0, runes) } func TestExact(t *testing.T) { @@ -135,7 +135,7 @@ func TestOrigTextAndTransformed(t *testing.T) { chunk.items[0] = Item{ text: util.ToChars([]byte("junegunn")), origText: &origBytes, - transformed: &transformed{pattern.nth, trans}} + transformed: &transformed{pattern.revision, trans}} pattern.extended = extended matches := pattern.matchChunk(&chunk, nil, slab) // No cache if !(matches[0].item.text.ToString() == "junegunn" && -- cgit v1.2.3