summaryrefslogtreecommitdiffstats
path: root/src/options_test.go
diff options
context:
space:
mode:
authorJunegunn Choi <junegunn.c@gmail.com>2017-08-27 02:19:39 +0900
committerJunegunn Choi <junegunn.c@gmail.com>2017-08-27 02:19:56 +0900
commitfee404399adcebc0c6253e2ef4dc95871f81c806 (patch)
tree4d7cbd14f0196c32167a5acefabe95056a853483 /src/options_test.go
parent6b4805ca1a1b0758363d1bb8c4c996730e19dc5a (diff)
Make --expect additive
Similarly to --bind or --color. --expect used to replace the previously specified keys, and fzf#wrap({'options': '--expect=f1'}) wouldn't work as expected. It forced us to come up with some ugly hacks like the following: https://github.com/junegunn/fzf.vim/blob/13b27c45c8bdf6c3a41376bb83e4895edadf8c7e/autoload/fzf/vim.vim#L1086
Diffstat (limited to 'src/options_test.go')
-rw-r--r--src/options_test.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/options_test.go b/src/options_test.go
index d3c93450..22f4e4ee 100644
--- a/src/options_test.go
+++ b/src/options_test.go
@@ -414,3 +414,10 @@ func TestPreviewOpts(t *testing.T) {
t.Error(opts.Preview)
}
}
+
+func TestAdditiveExpect(t *testing.T) {
+ opts := optsFor("--expect=a", "--expect", "b", "--expect=c")
+ if len(opts.Expect) != 3 {
+ t.Error(opts.Expect)
+ }
+}