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

Function Less

assert/assertion_compare.go:416–422  ·  view source on GitHub ↗

Less asserts that the first element is less than the second assert.Less(t, 1, 2) assert.Less(t, float64(1), float64(2)) assert.Less(t, "a", "b")

(t TestingT, e1 interface{}, e2 interface{}, msgAndArgs ...interface{})

Source from the content-addressed store, hash-verified

414// assert.Less(t, float64(1), float64(2))
415// assert.Less(t, "a", "b")
416func Less(t TestingT, e1 interface{}, e2 interface{}, msgAndArgs ...interface{}) bool {
417 if h, ok := t.(tHelper); ok {
418 h.Helper()
419 }
420 failMessage := fmt.Sprintf("\"%v\" is not less than \"%v\"", e1, e2)
421 return compareTwoValues(t, e1, e2, []compareResult{compareLess}, failMessage, msgAndArgs...)
422}
423
424// LessOrEqual asserts that the first element is less than or equal to the second
425//

Callers 5

LessFunction · 0.92
LessfFunction · 0.70
TestLessFunction · 0.70
LessMethod · 0.70

Calls 2

compareTwoValuesFunction · 0.85
HelperMethod · 0.65

Tested by 2

TestLessFunction · 0.56