assert fails the test if the condition is false.
(tb testing.TB, condition bool, msg string, v ...interface{})
| 197 | |
| 198 | // assert fails the test if the condition is false. |
| 199 | func Assert(tb testing.TB, condition bool, msg string, v ...interface{}) { |
| 200 | if !condition { |
| 201 | fmt.Printf("%s "+msg+"\n\n", append([]interface{}{caller()}, v...)...) |
| 202 | tb.FailNow() |
| 203 | } |
| 204 | } |
| 205 | |
| 206 | // ok fails the test if an err is not nil. |
| 207 | func Ok(tb testing.TB, err error, args ...interface{}) { |