go113_test.go 312 B

12345678910111213141516
  1. // +build go1.13
  2. package errors
  3. import (
  4. stdlib_errors "errors"
  5. "testing"
  6. )
  7. func TestErrorChainCompat(t *testing.T) {
  8. err := stdlib_errors.New("error that gets wrapped")
  9. wrapped := Wrap(err, "wrapped up")
  10. if !stdlib_errors.Is(wrapped, err) {
  11. t.Errorf("Wrap does not support Go 1.13 error chains")
  12. }
  13. }