MCPcopy
hub / github.com/stretchr/testify / Positive

Function Positive

assert/assertion_compare.go:442–449  ·  assert/assertion_compare.go::Positive

Positive asserts that the specified element is positive assert.Positive(t, 1) assert.Positive(t, 1.23)

(t TestingT, e interface{}, msgAndArgs ...interface{})

Source from the content-addressed store, hash-verified

440// assert.Positive(t, 1)
441// assert.Positive(t, 1.23)
442func 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//

Callers 5

PositiveFunction · 0.92
PositivefFunction · 0.70
TestPositiveFunction · 0.70
PositiveMethod · 0.70

Calls 3

compareTwoValuesFunction · 0.85
HelperMethod · 0.65
ZeroMethod · 0.45

Tested by 2

TestPositiveFunction · 0.56