diff options
Diffstat (limited to 'src/pattern_test.go')
| -rw-r--r-- | src/pattern_test.go | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/pattern_test.go b/src/pattern_test.go index 30691107..2a391f4d 100644 --- a/src/pattern_test.go +++ b/src/pattern_test.go @@ -135,10 +135,16 @@ func TestOrigTextAndTransformed(t *testing.T) { pattern.extended = extended matches := pattern.matchChunk(&chunk, nil) // No cache if matches[0].item.text.ToString() != "junegunn" || string(*matches[0].item.origText) != "junegunn.choi" || - matches[0].offsets[0][0] != 0 || matches[0].offsets[0][1] != 5 || !reflect.DeepEqual(matches[0].item.transformed, trans) { t.Error("Invalid match result", matches) } + + match, offsets := pattern.MatchItem(chunk[0]) + 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) { + t.Error("Invalid match result", match) + } } } |
