summaryrefslogtreecommitdiff
path: root/src/options_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/options_test.go')
-rw-r--r--src/options_test.go21
1 files changed, 11 insertions, 10 deletions
diff --git a/src/options_test.go b/src/options_test.go
index eb1dfa9c..c1bc9147 100644
--- a/src/options_test.go
+++ b/src/options_test.go
@@ -5,6 +5,7 @@ import (
"testing"
"github.com/junegunn/fzf/src/curses"
+ "github.com/junegunn/fzf/src/util"
)
func TestDelimiterRegex(t *testing.T) {
@@ -42,24 +43,24 @@ func TestDelimiterRegex(t *testing.T) {
func TestDelimiterRegexString(t *testing.T) {
delim := delimiterRegexp("*")
- tokens := Tokenize([]rune("-*--*---**---"), delim)
+ tokens := Tokenize(util.RunesToChars([]rune("-*--*---**---")), delim)
if delim.regex != nil ||
- string(tokens[0].text) != "-*" ||
- string(tokens[1].text) != "--*" ||
- string(tokens[2].text) != "---*" ||
- string(tokens[3].text) != "*" ||
- string(tokens[4].text) != "---" {
+ tokens[0].text.ToString() != "-*" ||
+ tokens[1].text.ToString() != "--*" ||
+ tokens[2].text.ToString() != "---*" ||
+ tokens[3].text.ToString() != "*" ||
+ tokens[4].text.ToString() != "---" {
t.Errorf("%s %s %d", delim, tokens, len(tokens))
}
}
func TestDelimiterRegexRegex(t *testing.T) {
delim := delimiterRegexp("--\\*")
- tokens := Tokenize([]rune("-*--*---**---"), delim)
+ tokens := Tokenize(util.RunesToChars([]rune("-*--*---**---")), delim)
if delim.str != nil ||
- string(tokens[0].text) != "-*--*" ||
- string(tokens[1].text) != "---*" ||
- string(tokens[2].text) != "*---" {
+ tokens[0].text.ToString() != "-*--*" ||
+ tokens[1].text.ToString() != "---*" ||
+ tokens[2].text.ToString() != "*---" {
t.Errorf("%s %d", tokens, len(tokens))
}
}