From ba0935c71f5507958056201ddad2fc48674a586d Mon Sep 17 00:00:00 2001 From: Junegunn Choi Date: Mon, 13 Jan 2025 12:45:01 +0900 Subject: Fix change-nth * Proper clean-up of caches * Force rerender list after the action --- src/pattern_test.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/pattern_test.go') diff --git a/src/pattern_test.go b/src/pattern_test.go index 9f105f6a..1487d704 100644 --- a/src/pattern_test.go +++ b/src/pattern_test.go @@ -135,12 +135,12 @@ func TestOrigTextAndTransformed(t *testing.T) { chunk.items[0] = Item{ text: util.ToChars([]byte("junegunn")), origText: &origBytes, - transformed: &trans} + transformed: &transformed{pattern.nth, trans}} pattern.extended = extended matches := pattern.matchChunk(&chunk, nil, slab) // No cache if !(matches[0].item.text.ToString() == "junegunn" && string(*matches[0].item.origText) == "junegunn.choi" && - reflect.DeepEqual(*matches[0].item.transformed, trans)) { + reflect.DeepEqual((*matches[0].item.transformed).tokens, trans)) { t.Error("Invalid match result", matches) } @@ -148,7 +148,7 @@ func TestOrigTextAndTransformed(t *testing.T) { if !(match.item.text.ToString() == "junegunn" && string(*match.item.origText) == "junegunn.choi" && offsets[0][0] == 0 && offsets[0][1] == 5 && - reflect.DeepEqual(*match.item.transformed, trans)) { + reflect.DeepEqual((*match.item.transformed).tokens, trans)) { t.Error("Invalid match result", match, offsets, extended) } if !((*pos)[0] == 4 && (*pos)[1] == 0) { -- cgit v1.2.3