Skip to content

Commit a49b9aa

Browse files
committed
fix(completion): sort test cases
1 parent efc9493 commit a49b9aa

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

internal/settings/completion_test.go

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package settings_test
22

33
import (
4+
"slices"
45
"strings"
56
"testing"
67

@@ -29,16 +30,16 @@ func TestCompleteConfigFlag(t *testing.T) {
2930
{"ent", []string{"enter."}},
3031

3132
// Fields after a . should be underneath the nested option
32-
{"option.", []string{"option.min_score", "option.prettify", "option.debounce_time"}},
33+
{"option.", []string{"option.debounce_time", "option.min_score", "option.prettify"}},
3334

34-
{"apply.use_", []string{"apply.use_nom", "apply.use_git_commit_msg"}},
35+
{"apply.use_", []string{"apply.use_git_commit_msg", "apply.use_nom"}},
3536

3637
// Invalid fields should result in no completions
3738
{"invalid", []string{}},
3839
{"bruh.lmao", []string{}},
3940

4041
// Boolean field value completion
41-
{"color=", []string{"color=true", "color=false"}},
42+
{"color=", []string{"color=false", "color=true"}},
4243
{"color=t", []string{"color=true"}},
4344
{"color=f", []string{"color=false"}},
4445
{"color=invalid", []string{}},
@@ -52,6 +53,8 @@ func TestCompleteConfigFlag(t *testing.T) {
5253
actual[i] = stripAfterTab(v)
5354
}
5455

56+
slices.Sort(actual)
57+
5558
if !slicesEqual(actual, testCase.Expected) {
5659
t.Errorf("for input '%s': expected %v, got %v", testCase.Input, testCase.Expected, actual)
5760
}

0 commit comments

Comments
 (0)