From 827a83efbc178390ddd8aaa36d26bce593d0d58f Mon Sep 17 00:00:00 2001 From: Junegunn Choi Date: Sat, 20 Aug 2016 01:46:54 +0900 Subject: Remove Offset slice from Result struct --- src/pattern_test.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/pattern_test.go') 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) + } } } -- cgit v1.2.3