@@ -392,31 +392,31 @@ func TestRego_MatchesEvaluation(t *testing.T) {
392392 Source : regoContent ,
393393 }
394394
395- t .Run ("evaluation with violations and high severity matches " , func (t * testing.T ) {
395+ t .Run ("evaluation with violations and high severity does not match " , func (t * testing.T ) {
396396 violations := []string {"test violation" }
397397 evaluationParams := map [string ]string {"severity" : "high" }
398398 matches , err := r .MatchesEvaluation (context .TODO (), policy , violations , evaluationParams )
399399 require .NoError (t , err )
400- assert .True (t , matches )
400+ assert .False (t , matches )
401401 })
402402
403- t .Run ("evaluation without violations does not match " , func (t * testing.T ) {
403+ t .Run ("evaluation without violations does matches " , func (t * testing.T ) {
404404 violations := []string {}
405405 evaluationParams := map [string ]string {"severity" : "high" }
406406 matches , err := r .MatchesEvaluation (context .TODO (), policy , violations , evaluationParams )
407407 require .NoError (t , err )
408408 assert .False (t , matches )
409409 })
410410
411- t .Run ("evaluation with violations but wrong severity does not match" , func (t * testing.T ) {
411+ t .Run ("evaluation with violations but wrong severity does match" , func (t * testing.T ) {
412412 violations := []string {"test violation" }
413413 evaluationParams := map [string ]string {"severity" : "low" }
414414 matches , err := r .MatchesEvaluation (context .TODO (), policy , violations , evaluationParams )
415415 require .NoError (t , err )
416416 assert .False (t , matches )
417417 })
418418
419- t .Run ("nil evaluation does not match " , func (t * testing.T ) {
419+ t .Run ("nil evaluation matches " , func (t * testing.T ) {
420420 evaluationParams := map [string ]string {"severity" : "high" }
421421 matches , err := r .MatchesEvaluation (context .TODO (), policy , nil , evaluationParams )
422422 require .NoError (t , err )
0 commit comments