github.com/WindomZ/go-commander@v1.2.2/error_test.go (about)

     1  package commander
     2  
     3  import (
     4  	"github.com/WindomZ/testify/assert"
     5  	"testing"
     6  )
     7  
     8  func TestError_newError(t *testing.T) {
     9  	assert.Equal(t, newError("test").Error(), "go-commander: test")
    10  }
    11  
    12  func TestError_panicError(t *testing.T) {
    13  	defer func() {
    14  		assert.NotEmpty(t, recover())
    15  	}()
    16  	panicError("test")
    17  	assert.Fail(t, "fail to panic error!")
    18  }