Skip to content

Commit

Permalink
Add more constraint-matching test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
lizrice committed Oct 23, 2019
1 parent b8bdf8d commit a4eda80
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions check/check_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,30 @@ func TestGetFirstValidSubCheck(t *testing.T) {
},
},
},
{
// Should match if there are no constraints on the test at all
Expected: true,
SubChecks: []*SubCheck{
{
BaseCheck{
Constraints: map[string][]string{},
Remediation: "Expected",
},
},
},
},
{
// Should not match if there are constraints on the test that aren't defined for this run
Expected: false,
SubChecks: []*SubCheck{
{
BaseCheck{
Constraints: map[string][]string{"something": []string{"not", "defined"}},
Remediation: "Expected",
},
},
},
},
}

for ii, testCase := range testCases {
Expand Down

0 comments on commit a4eda80

Please sign in to comment.