Condition uses a Comparison to assert a complex condition.
(t TestingT, comp Comparison, msgAndArgs ...interface{})
| 1210 | |
| 1211 | // Condition uses a Comparison to assert a complex condition. |
| 1212 | func 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. |