11package settings_test
22
33import (
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