NotZero asserts that i is not the zero value for its type.
(t TestingT, i interface{}, msgAndArgs ...interface{})
| 1676 | |
| 1677 | // NotZero asserts that i is not the zero value for its type. |
| 1678 | func NotZero(t TestingT, i interface{}, msgAndArgs ...interface{}) bool { |
| 1679 | if h, ok := t.(tHelper); ok { |
| 1680 | h.Helper() |
| 1681 | } |
| 1682 | if i == nil || reflect.DeepEqual(i, reflect.Zero(reflect.TypeOf(i)).Interface()) { |
| 1683 | return Fail(t, fmt.Sprintf("Should not be zero, but was %v", i), msgAndArgs...) |
| 1684 | } |
| 1685 | return true |
| 1686 | } |
| 1687 | |
| 1688 | // FileExists checks whether a file exists in the given path. It also fails if |
| 1689 | // the path points to a directory or there is an error when trying to check the file. |
searching dependent graphs…