summaryrefslogtreecommitdiff
path: root/src/pattern_test.go
diff options
context:
space:
mode:
authorJunegunn Choi <junegunn.c@gmail.com>2025-01-13 17:37:50 +0900
committerJunegunn Choi <junegunn.c@gmail.com>2025-01-13 17:37:50 +0900
commit56fef7c8df2713261fbdbd396aa81ed23d9a945a (patch)
treeb8f8c52f84f7c4a37cca062dcc871e91fc63f160 /src/pattern_test.go
parentba0935c71f5507958056201ddad2fc48674a586d (diff)
downloadfzf-56fef7c8df2713261fbdbd396aa81ed23d9a945a.tar.gz
Simplify nth comparison when reusing transformed tokens
Diffstat (limited to 'src/pattern_test.go')
-rw-r--r--src/pattern_test.go4
1 files changed, 2 insertions, 2 deletions
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" &&