Skip to content

Commit

Permalink
added test to ensure custom rules are included
Browse files Browse the repository at this point in the history
  • Loading branch information
hagarfisher committed Aug 11, 2023
1 parent db49eb9 commit 00f0410
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions secrets/secrets_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,24 @@ func TestLoadAllRules_DuplicateRuleID(t *testing.T) {
}
}

func TestLoadAllRules_CustomRulesLoaded(t *testing.T) {
allRules, err := loadAllRules()
ruleIDMap := make(map[string]bool)
if err != nil {
t.Error(err)
}

for _, rule := range allRules {
ruleIDMap[rule.Rule.RuleID] = true
}
for _, customRule := range customRules {
_, ok := ruleIDMap[customRule.RuleID]
if !ok {
t.Errorf("custom rule not found: %s", customRule.RuleID)
}
}
}

func TestIsAllFilter_AllFilterNotPresent(t *testing.T) {
filters := []string{"token", "key"}

Expand Down

0 comments on commit 00f0410

Please sign in to comment.