summaryrefslogtreecommitdiff
path: root/src/options_test.go
diff options
context:
space:
mode:
authorJunegunn Choi <junegunn.c@gmail.com>2025-01-12 10:23:43 +0900
committerJunegunn Choi <junegunn.c@gmail.com>2025-01-12 10:23:43 +0900
commit5460517bd2ecf5c3437cfe77821b3cf524bc69d5 (patch)
tree848a6096a0fd1b8d41771dea150e824ff9f1adf3 /src/options_test.go
parent9a6e557e5237a6f5476cd602fc6425d3f05700b3 (diff)
downloadfzf-5460517bd2ecf5c3437cfe77821b3cf524bc69d5.tar.gz
Treat a single-character delimiter as a plain string delimiter
even if it's a regular expression meta-character Close #4170
Diffstat (limited to 'src/options_test.go')
-rw-r--r--src/options_test.go8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/options_test.go b/src/options_test.go
index 5def73dc..40d2920b 100644
--- a/src/options_test.go
+++ b/src/options_test.go
@@ -9,9 +9,13 @@ import (
)
func TestDelimiterRegex(t *testing.T) {
- // Valid regex
+ // Valid regex, but a single character -> string
delim := delimiterRegexp(".")
- if delim.regex == nil || delim.str != nil {
+ if delim.regex != nil || *delim.str != "." {
+ t.Error(delim)
+ }
+ delim = delimiterRegexp("|")
+ if delim.regex != nil || *delim.str != "|" {
t.Error(delim)
}
// Broken regex -> string