Set assertion handler Chain always overrides assertion handler with given one.
(handler AssertionHandler)
| 275 | // Set assertion handler |
| 276 | // Chain always overrides assertion handler with given one. |
| 277 | func (c *chain) setHandler(handler AssertionHandler) { |
| 278 | c.mu.Lock() |
| 279 | defer c.mu.Unlock() |
| 280 | |
| 281 | if chainValidation && c.state == stateLeaved { |
| 282 | panic("can't use chain after leave") |
| 283 | } |
| 284 | |
| 285 | c.handler = handler |
| 286 | c.context.TestingTB = isTestingTB(handler) |
| 287 | } |
| 288 | |
| 289 | // Create chain clone. |
| 290 | // Typically is called between enter() and leave(). |
no test coverage detected