Positive asserts that the specified element is positive assert.Positive(t, 1) assert.Positive(t, 1.23)
(t TestingT, e interface{}, msgAndArgs ...interface{})
| 440 | // assert.Positive(t, 1) |
| 441 | // assert.Positive(t, 1.23) |
| 442 | func Positive(t TestingT, e interface{}, msgAndArgs ...interface{}) bool { |
| 443 | if h, ok := t.(tHelper); ok { |
| 444 | h.Helper() |
| 445 | } |
| 446 | zero := reflect.Zero(reflect.TypeOf(e)) |
| 447 | failMessage := fmt.Sprintf("\"%v\" is not positive", e) |
| 448 | return compareTwoValues(t, e, zero.Interface(), []compareResult{compareGreater}, failMessage, msgAndArgs...) |
| 449 | } |
| 450 | |
| 451 | // Negative asserts that the specified element is negative |
| 452 | // |