Condition uses a Comparison to assert a complex condition.
(t TestingT, comp Comparison, msgAndArgs ...interface{})
| 1176 | |
| 1177 | // Condition uses a Comparison to assert a complex condition. |
| 1178 | func Condition(t TestingT, comp Comparison, msgAndArgs ...interface{}) bool { |
| 1179 | if h, ok := t.(tHelper); ok { |
| 1180 | h.Helper() |
| 1181 | } |
| 1182 | result := comp() |
| 1183 | if !result { |
| 1184 | Fail(t, "Condition failed!", msgAndArgs...) |
| 1185 | } |
| 1186 | return result |
| 1187 | } |
| 1188 | |
| 1189 | // PanicTestFunc defines a func that should be passed to the assert.Panics and assert.NotPanics |
| 1190 | // methods, and represents a simple func that takes no arguments, and returns nothing. |
searching dependent graphs…