summaryrefslogtreecommitdiffstats
path: root/src/options_test.go
diff options
context:
space:
mode:
authorJunegunn Choi <junegunn.c@gmail.com>2017-07-20 02:44:30 +0900
committerJunegunn Choi <junegunn.c@gmail.com>2017-07-20 02:44:30 +0900
commitc9f16b6430f3b9c9d12ee078e2218e8467c13340 (patch)
treeb0d7e33da2d605696d98da98e1691bf8d89437de /src/options_test.go
parentbc9d2abdb67639e06f7002b278341fb498b79456 (diff)
Avoid unconditionally storsing input as runes
When --with-nth is used, fzf used to preprocess each line and store the result as rune array, which was wasteful if the line only contains ascii characters.
Diffstat (limited to 'src/options_test.go')
-rw-r--r--src/options_test.go5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/options_test.go b/src/options_test.go
index 907faf03..d3c93450 100644
--- a/src/options_test.go
+++ b/src/options_test.go
@@ -6,7 +6,6 @@ import (
"testing"
"github.com/junegunn/fzf/src/tui"
- "github.com/junegunn/fzf/src/util"
)
func TestDelimiterRegex(t *testing.T) {
@@ -44,7 +43,7 @@ func TestDelimiterRegex(t *testing.T) {
func TestDelimiterRegexString(t *testing.T) {
delim := delimiterRegexp("*")
- tokens := Tokenize(util.RunesToChars([]rune("-*--*---**---")), delim)
+ tokens := Tokenize("-*--*---**---", delim)
if delim.regex != nil ||
tokens[0].text.ToString() != "-*" ||
tokens[1].text.ToString() != "--*" ||
@@ -57,7 +56,7 @@ func TestDelimiterRegexString(t *testing.T) {
func TestDelimiterRegexRegex(t *testing.T) {
delim := delimiterRegexp("--\\*")
- tokens := Tokenize(util.RunesToChars([]rune("-*--*---**---")), delim)
+ tokens := Tokenize("-*--*---**---", delim)
if delim.str != nil ||
tokens[0].text.ToString() != "-*--*" ||
tokens[1].text.ToString() != "---*" ||