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

Function Condition

assert/assertions.go:1264–1273  ·  assert/assertions.go::Condition

Condition uses a Comparison to assert a complex condition.

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

Source from the content-addressed store, hash-verified

1262
1263// Condition uses a Comparison to assert a complex condition.
1264func Condition(t TestingT, comp Comparison, msgAndArgs ...interface{}) bool {
1265 if h, ok := t.(tHelper); ok {
1266 h.Helper()
1267 }
1268 result := comp()
1269 if !result {
1270 Fail(t, "Condition failed!", msgAndArgs...)
1271 }
1272 return result
1273}
1274
1275// PanicTestFunc defines a func that should be passed to the assert.Panics and assert.NotPanics
1276// 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