(t *testing.T)
| 95 | } |
| 96 | |
| 97 | func TestValidateActionPositives(t *testing.T) { |
| 98 | tsts := []struct { |
| 99 | Name string |
| 100 | Action Action |
| 101 | WantNoErrString string |
| 102 | }{ |
| 103 | {"invalidKind", Action{Kind: NotifyAction}, "invalid rule action kind"}, |
| 104 | } |
| 105 | for _, tst := range tsts { |
| 106 | t.Run(tst.Name, func(t *testing.T) { |
| 107 | errs := validateAction(&tst.Action) |
| 108 | for _, err := range errs { |
| 109 | t.Logf("Got error %#v", err) |
| 110 | if strings.Contains(err.Error(), tst.WantNoErrString) { |
| 111 | t.Errorf("errs: got %#v, want none containing %q", errs, tst.WantNoErrString) |
| 112 | } |
| 113 | } |
| 114 | }) |
| 115 | } |
| 116 | } |
| 117 | |
| 118 | func TestValidateConditionNegatives(t *testing.T) { |
| 119 | tsts := []struct { |
nothing calls this directly
no test coverage detected