diff options
author | Junegunn Choi <junegunn.c@gmail.com> | 2016-08-20 01:46:54 +0900 |
---|---|---|
committer | Junegunn Choi <junegunn.c@gmail.com> | 2016-08-20 01:53:32 +0900 |
commit | 827a83efbc178390ddd8aaa36d26bce593d0d58f (patch) | |
tree | f8f7533acf360e3e143892249f9e1613375638a3 /src/pattern_test.go | |
parent | 3e888493866d42845f11c4d57fc8f093a6e28644 (diff) |
Remove Offset slice from Result struct
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) + } } } |