diff options
| author | Junegunn Choi <junegunn.c@gmail.com> | 2025-01-12 10:23:43 +0900 |
|---|---|---|
| committer | Junegunn Choi <junegunn.c@gmail.com> | 2025-01-12 10:23:43 +0900 |
| commit | 5460517bd2ecf5c3437cfe77821b3cf524bc69d5 (patch) | |
| tree | 848a6096a0fd1b8d41771dea150e824ff9f1adf3 /src/options_test.go | |
| parent | 9a6e557e5237a6f5476cd602fc6425d3f05700b3 (diff) | |
| download | fzf-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.go | 8 |
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 |
