summaryrefslogtreecommitdiff
path: root/src/options_test.go
diff options
context:
space:
mode:
authorJunegunn Choi <junegunn.c@gmail.com>2024-06-01 19:50:17 +0900
committerJunegunn Choi <junegunn.c@gmail.com>2024-06-01 22:11:15 +0900
commite2f93e5a2dc30f2785916e0b2e7a2ab974d1ff0a (patch)
tree0e1d081b25e5e81948abdfc5b2e39b9f67fe2a49 /src/options_test.go
parentcfdf2f11537f8e4207b146250a14a4d1aa32b5f5 (diff)
downloadfzf-e2f93e5a2dc30f2785916e0b2e7a2ab974d1ff0a.tar.gz
--tmux vs. --height: Last one wins
Diffstat (limited to 'src/options_test.go')
-rw-r--r--src/options_test.go13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/options_test.go b/src/options_test.go
index 270af5c8..4a859b0e 100644
--- a/src/options_test.go
+++ b/src/options_test.go
@@ -106,10 +106,11 @@ func TestSplitNth(t *testing.T) {
}
func TestIrrelevantNth(t *testing.T) {
+ index := 0
{
opts := defaultOptions()
words := []string{"--nth", "..", "-x"}
- parseOptions(opts, words)
+ parseOptions(&index, opts, words)
postProcessOptions(opts)
if len(opts.Nth) != 0 {
t.Errorf("nth should be empty: %v", opts.Nth)
@@ -118,7 +119,7 @@ func TestIrrelevantNth(t *testing.T) {
for _, words := range [][]string{{"--nth", "..,3", "+x"}, {"--nth", "3,1..", "+x"}, {"--nth", "..-1,1", "+x"}} {
{
opts := defaultOptions()
- parseOptions(opts, words)
+ parseOptions(&index, opts, words)
postProcessOptions(opts)
if len(opts.Nth) != 0 {
t.Errorf("nth should be empty: %v", opts.Nth)
@@ -127,7 +128,7 @@ func TestIrrelevantNth(t *testing.T) {
{
opts := defaultOptions()
words = append(words, "-x")
- parseOptions(opts, words)
+ parseOptions(&index, opts, words)
postProcessOptions(opts)
if len(opts.Nth) != 2 {
t.Errorf("nth should not be empty: %v", opts.Nth)
@@ -335,10 +336,11 @@ func TestColorSpec(t *testing.T) {
}
func TestDefaultCtrlNP(t *testing.T) {
+ index := 0
check := func(words []string, et tui.EventType, expected actionType) {
e := et.AsEvent()
opts := defaultOptions()
- parseOptions(opts, words)
+ parseOptions(&index, opts, words)
postProcessOptions(opts)
if opts.Keymap[e][0].t != expected {
t.Error()
@@ -364,8 +366,9 @@ func TestDefaultCtrlNP(t *testing.T) {
}
func optsFor(words ...string) *Options {
+ index := 0
opts := defaultOptions()
- parseOptions(opts, words)
+ parseOptions(&index, opts, words)
postProcessOptions(opts)
return opts
}