Negative asserts that the specified element is negative assert.Negative(t, -1) assert.Negative(t, -1.23)
(t TestingT, e interface{}, msgAndArgs ...interface{})
| 448 | // assert.Negative(t, -1) |
| 449 | // assert.Negative(t, -1.23) |
| 450 | func Negative(t TestingT, e interface{}, msgAndArgs ...interface{}) bool { |
| 451 | if h, ok := t.(tHelper); ok { |
| 452 | h.Helper() |
| 453 | } |
| 454 | zero := reflect.Zero(reflect.TypeOf(e)) |
| 455 | return compareTwoValues(t, e, zero.Interface(), []compareResult{compareLess}, "\"%v\" is not negative", msgAndArgs...) |
| 456 | } |
| 457 | |
| 458 | func compareTwoValues(t TestingT, e1 interface{}, e2 interface{}, allowedComparesResults []compareResult, failMessage string, msgAndArgs ...interface{}) bool { |
| 459 | if h, ok := t.(tHelper); ok { |
searching dependent graphs…