From e2f93e5a2dc30f2785916e0b2e7a2ab974d1ff0a Mon Sep 17 00:00:00 2001 From: Junegunn Choi Date: Sat, 1 Jun 2024 19:50:17 +0900 Subject: --tmux vs. --height: Last one wins --- src/options_test.go | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'src/options_test.go') 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 } -- cgit v1.2.3