@@ -1580,7 +1580,7 @@ func TestTreeRootExclusivity(t *testing.T) {
1580
1580
},
1581
1581
}
1582
1582
1583
- permutations := [][]string {
1583
+ invalidCombinations := [][]string {
1584
1584
{"tree-root" , "tree-root-cmd" },
1585
1585
{"tree-root" , "tree-root-file" },
1586
1586
{"tree-root-cmd" , "tree-root-file" },
@@ -1591,11 +1591,11 @@ func TestTreeRootExclusivity(t *testing.T) {
1591
1591
// Given that ultimately everything is being reduced into the config object after parsing from viper, I'm fairly
1592
1592
// confident if these tests all pass then the mixed methods should yield the same result.
1593
1593
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 {
1596
1596
// test flags
1597
1597
var args []string
1598
- for _ , key := range perm {
1598
+ for _ , key := range combination {
1599
1599
args = append (args , flagValues [key ]... )
1600
1600
}
1601
1601
@@ -1607,7 +1607,7 @@ func TestTreeRootExclusivity(t *testing.T) {
1607
1607
// test env variables
1608
1608
env := make (map [string ]string )
1609
1609
1610
- for _ , key := range perm {
1610
+ for _ , key := range combination {
1611
1611
entry := envValues [key ]
1612
1612
env [entry [0 ]] = entry [1 ]
1613
1613
}
@@ -1622,7 +1622,7 @@ func TestTreeRootExclusivity(t *testing.T) {
1622
1622
FormatterConfigs : formatterConfigs ,
1623
1623
}
1624
1624
1625
- for _ , key := range perm {
1625
+ for _ , key := range combination {
1626
1626
entry := configValues [key ]
1627
1627
entry (cfg )
1628
1628
}
0 commit comments