...

Source file src/github.com/ory/x/errorsx/errors_test.go

Documentation: github.com/ory/x/errorsx

     1  package errorsx
     2  
     3  import (
     4  	"testing"
     5  
     6  	"github.com/pkg/errors"
     7  	"github.com/stretchr/testify/assert"
     8  )
     9  
    10  func TestWithStack(t *testing.T) {
    11  	t.Run("case=wrap", func(t *testing.T) {
    12  		orig := errors.New("hi")
    13  		wrap := WithStack(orig)
    14  
    15  		assert.EqualValues(t, orig.(StackTracer).StackTrace(), wrap.(StackTracer).StackTrace())
    16  		assert.EqualValues(t, orig.(StackTracer).StackTrace(), WithStack(wrap).(StackTracer).StackTrace())
    17  	})
    18  }
    19  

View as plain text