Check PromptKit capabilities without assuming their order
This commit is contained in:
@@ -6,6 +6,7 @@ import (
|
||||
"errors"
|
||||
"io"
|
||||
"reflect"
|
||||
"slices"
|
||||
"strings"
|
||||
"testing"
|
||||
"testing/fstest"
|
||||
@@ -162,9 +163,14 @@ func TestConfigScopeCompareUsesNativeDiffAndLoadsBothEqualSelections(t *testing.
|
||||
}
|
||||
return rightEngine, nil
|
||||
})
|
||||
if scope.Compare == nil || len(scope.Operations) != 5 || scope.Operations[4] != ckconfig.Diff {
|
||||
if scope.Compare == nil {
|
||||
t.Fatalf("configuration scope does not declare comparison: %#v", scope)
|
||||
}
|
||||
for _, operation := range []ckconfig.Operation{ckconfig.Validate, ckconfig.Show, ckconfig.Sources, ckconfig.Explain, ckconfig.Diff} {
|
||||
if !slices.Contains(scope.Operations, operation) {
|
||||
t.Fatalf("configuration scope is missing operation %q: %#v", operation, scope.Operations)
|
||||
}
|
||||
}
|
||||
|
||||
selection := ckconfig.Selection{Config: commandkit.Supplied[string]{Value: "same-selection.yml", Set: true}}
|
||||
state := new(int)
|
||||
|
||||
Reference in New Issue
Block a user