MCPcopy Create free account
hub / github.com/stretchr/testify / Condition

Function Condition

assert/assertions.go:1212–1221  ·  view source on GitHub ↗

Condition uses a Comparison to assert a complex condition.

(t TestingT, comp Comparison, msgAndArgs ...interface{})

Source from the content-addressed store, hash-verified

1210
1211// Condition uses a Comparison to assert a complex condition.
1212func Condition(t TestingT, comp Comparison, msgAndArgs ...interface{}) bool {
1213 if h, ok := t.(tHelper); ok {
1214 h.Helper()
1215 }
1216 result := comp()
1217 if !result {
1218 Fail(t, "Condition failed!", msgAndArgs...)
1219 }
1220 return result
1221}
1222
1223// PanicTestFunc defines a func that should be passed to the assert.Panics and assert.NotPanics
1224// methods, and represents a simple func that takes no arguments, and returns nothing.

Callers 4

ConditionFunction · 0.92
ConditionfFunction · 0.70
TestConditionFunction · 0.70
ConditionMethod · 0.70

Calls 2

FailFunction · 0.70
HelperMethod · 0.65

Tested by 1

TestConditionFunction · 0.56