gitlab.com/ignitionrobotics/web/ign-go@v1.0.0-rc4/errors/errors_test.go (about)

     1  package errors
     2  
     3  import (
     4  	"github.com/pkg/errors"
     5  	"github.com/stretchr/testify/suite"
     6  	"testing"
     7  )
     8  
     9  func TestErrorUtils(t *testing.T) {
    10  	suite.Run(t, new(errorUtilsTestSuite))
    11  }
    12  
    13  type errorUtilsTestSuite struct {
    14  	suite.Suite
    15  }
    16  
    17  // WARNING: This test is sensitive to the line number it runs in.
    18  // Any new tests must be added below this test.
    19  func (s *errorUtilsTestSuite) TestWithFunctionContext() {
    20  	errMsg := WithFunctionContext(errors.New("test"), "example", 1).Error()
    21  	s.Require().Contains(errMsg, "TestWithFunctionContext")
    22  }