Skip to content

Commit 8ce083e

Browse files
committed
feat: find tree root via a user-specified command
Signed-off-by: Brian McGee <[email protected]>
1 parent ea56597 commit 8ce083e

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

cmd/root_test.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1580,7 +1580,7 @@ func TestTreeRootExclusivity(t *testing.T) {
15801580
},
15811581
}
15821582

1583-
permutations := [][]string{
1583+
invalidCombinations := [][]string{
15841584
{"tree-root", "tree-root-cmd"},
15851585
{"tree-root", "tree-root-file"},
15861586
{"tree-root-cmd", "tree-root-file"},
@@ -1591,11 +1591,11 @@ func TestTreeRootExclusivity(t *testing.T) {
15911591
// Given that ultimately everything is being reduced into the config object after parsing from viper, I'm fairly
15921592
// confident if these tests all pass then the mixed methods should yield the same result.
15931593

1594-
// test permutations of the same type
1595-
for _, perm := range permutations {
1594+
// for each set of invalid args, test them with flags, environment variables, and config entries.
1595+
for _, combination := range invalidCombinations {
15961596
// test flags
15971597
var args []string
1598-
for _, key := range perm {
1598+
for _, key := range combination {
15991599
args = append(args, flagValues[key]...)
16001600
}
16011601

@@ -1607,7 +1607,7 @@ func TestTreeRootExclusivity(t *testing.T) {
16071607
// test env variables
16081608
env := make(map[string]string)
16091609

1610-
for _, key := range perm {
1610+
for _, key := range combination {
16111611
entry := envValues[key]
16121612
env[entry[0]] = entry[1]
16131613
}
@@ -1622,7 +1622,7 @@ func TestTreeRootExclusivity(t *testing.T) {
16221622
FormatterConfigs: formatterConfigs,
16231623
}
16241624

1625-
for _, key := range perm {
1625+
for _, key := range combination {
16261626
entry := configValues[key]
16271627
entry(cfg)
16281628
}

0 commit comments

Comments
 (0)