mirror of
https://github.com/fluencelabs/tendermint
synced 2025-04-25 06:42:16 +00:00
15 lines
217 B
Go
15 lines
217 B
Go
|
package test
|
||
|
|
||
|
import (
|
||
|
"testing"
|
||
|
)
|
||
|
|
||
|
func AssertPanics(t *testing.T, msg string, f func()) {
|
||
|
defer func() {
|
||
|
if err := recover(); err == nil {
|
||
|
t.Errorf("Should have panic'd, but didn't: %v", msg)
|
||
|
}
|
||
|
}()
|
||
|
f()
|
||
|
}
|