Skip to content

Commit

Permalink
Add diamond test case
Browse files Browse the repository at this point in the history
  • Loading branch information
ethan-lowman-dd committed Jul 14, 2021
1 parent 87676a3 commit bf42347
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion client/delegations_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,6 @@ func TestDelegationsIterator(t *testing.T) {
file: "",
resultOrder: []string{"a", "b", "d", "e"},
},

{
testName: "cycle avoided 2",
roles: map[string][]data.DelegatedRole{
Expand All @@ -125,6 +124,24 @@ func TestDelegationsIterator(t *testing.T) {
file: "",
resultOrder: []string{"a", "b", "c"},
},
{
testName: "diamond delegation",
roles: map[string][]data.DelegatedRole{
"a": {
{Name: "b", Paths: defaultPathPatterns},
{Name: "c", Paths: defaultPathPatterns},
},
"b": {
{Name: "d", Paths: defaultPathPatterns},
},
"c": {
{Name: "d", Paths: defaultPathPatterns},
},
},
rootDelegation: data.DelegatedRole{Name: "a", Paths: defaultPathPatterns},
file: "",
resultOrder: []string{"a", "b", "d", "c"},
},
}

for _, tt := range iteratorTests {
Expand Down

0 comments on commit bf42347

Please sign in to comment.