MCPcopy
hub / github.com/expr-lang/expr / Negative

Function Negative

internal/testify/assert/assertion_compare.go:450–456  ·  view source on GitHub ↗

Negative asserts that the specified element is negative assert.Negative(t, -1) assert.Negative(t, -1.23)

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

Source from the content-addressed store, hash-verified

448// assert.Negative(t, -1)
449// assert.Negative(t, -1.23)
450func 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
458func compareTwoValues(t TestingT, e1 interface{}, e2 interface{}, allowedComparesResults []compareResult, failMessage string, msgAndArgs ...interface{}) bool {
459 if h, ok := t.(tHelper); ok {

Callers 5

NegativeFunction · 0.92
NegativefFunction · 0.70
TestNegativeFunction · 0.70
NegativeMethod · 0.70

Calls 3

compareTwoValuesFunction · 0.85
HelperMethod · 0.45
ZeroMethod · 0.45

Tested by 2

TestNegativeFunction · 0.56

Used in the wild real call sites across dependent graphs

searching dependent graphs…