From 9e85cba0d06025983a1a747bfc06c9955388d9c0 Mon Sep 17 00:00:00 2001 From: Junegunn Choi Date: Sun, 16 Jul 2017 23:31:19 +0900 Subject: Reduce memory footprint of Item struct --- 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 5722be4a..31a127e3 100644 --- a/src/pattern_test.go +++ b/src/pattern_test.go @@ -142,13 +142,13 @@ func TestOrigTextAndTransformed(t *testing.T) { Item{ text: util.RunesToChars([]rune("junegunn")), origText: &origBytes, - transformed: trans}, + transformed: &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, trans)) { t.Error("Invalid match result", matches) } @@ -156,7 +156,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, trans)) { t.Error("Invalid match result", match, offsets, extended) } if !((*pos)[0] == 4 && (*pos)[1] == 0) { -- cgit v1.2.3