Check that err != nil and contains expected test
(t *testing.T, err error, s string)
| 73 | |
| 74 | // Check that err != nil and contains expected test |
| 75 | func assertErrorIs(t *testing.T, err error, s string) { |
| 76 | if err == nil { |
| 77 | if s != "" { |
| 78 | t.Errorf("Error expected") |
| 79 | } |
| 80 | return |
| 81 | } |
| 82 | |
| 83 | if !strings.HasPrefix(err.Error(), s) { |
| 84 | t.Errorf("Error is %q, expected %q", err, s) |
| 85 | } |
| 86 | } |
| 87 | |
| 88 | // parseTime parses time given in time.Layout format. |
| 89 | // this function panics if time cannot be parsed |
no outgoing calls
no test coverage detected