chore: Replace testify with gotest.tools in staking integration tests (#14504)

This commit is contained in:
Likhita Polavarapu
2023-01-11 14:20:20 +01:00
committed by GitHub
parent d5bcfb3f3e
commit f7ead8cbd8
13 changed files with 1051 additions and 848 deletions
+25
View File
@@ -0,0 +1,25 @@
package testutil
import "testing"
func AssertPanics(t *testing.T, f func()) {
panicked := false
defer func() {
if r := recover(); r != nil {
panicked = true
}
}()
f()
if !panicked {
t.Errorf("should panic")
}
}
func AssertNotPanics(t *testing.T, f func()) {
defer func() {
if r := recover(); r != nil {
t.Errorf("should not panic: %v", r)
}
}()
f()
}