summaryrefslogtreecommitdiffstats
path: root/src/pattern_test.go
diff options
context:
space:
mode:
authorJunegunn Choi <junegunn.c@gmail.com>2017-07-16 23:31:19 +0900
committerJunegunn Choi <junegunn.c@gmail.com>2017-07-16 23:34:32 +0900
commit9e85cba0d06025983a1a747bfc06c9955388d9c0 (patch)
tree8fe8dc1fd62ad3ecfbfd02e440fac6cfedcd313c /src/pattern_test.go
parent4b59ced08f1d417530a25af8fe13aa5d40579220 (diff)
Reduce memory footprint of Item struct
Diffstat (limited to 'src/pattern_test.go')
-rw-r--r--src/pattern_test.go6
1 files changed, 3 insertions, 3 deletions
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) {