NoErrorf asserts that a function returned no error (i.e. `nil`). actualObj, err := SomeFunction() if assert.NoErrorf(t, err, "error message %s", "formatted") { assert.Equal(t, expectedObj, actualObj) }
(t TestingT, err error, msg string, args ...interface{})
| 540 | // assert.Equal(t, expectedObj, actualObj) |
| 541 | // } |
| 542 | func NoErrorf(t TestingT, err error, msg string, args ...interface{}) bool { |
| 543 | if h, ok := t.(tHelper); ok { |
| 544 | h.Helper() |
| 545 | } |
| 546 | return NoError(t, err, append([]interface{}{msg}, args...)...) |
| 547 | } |
| 548 | |
| 549 | // NoFileExistsf checks whether a file does not exist in a given path. It fails |
| 550 | // if the path points to an existing _file_ only. |