github.com/supragya/TendermintConnector@v0.0.0-20210619045051-113e32b84fb1/_deprecated_chains/cosmos/libs/test/assert.go (about)

     1  package test
     2  
     3  import (
     4  	"testing"
     5  )
     6  
     7  func AssertPanics(t *testing.T, msg string, f func()) {
     8  	defer func() {
     9  		if err := recover(); err == nil {
    10  			t.Errorf("Should have panic'd, but didn't: %v", msg)
    11  		}
    12  	}()
    13  	f()
    14  }