tlog.app/go/errors@v0.9.0/errors_go1.13_test.go (about)

     1  //go:build go1.13
     2  // +build go1.13
     3  
     4  package errors
     5  
     6  import (
     7  	"os"
     8  	"testing"
     9  
    10  	"github.com/stretchr/testify/assert"
    11  )
    12  
    13  func TestIs(t *testing.T) {
    14  	mid := Wrap(os.ErrNotExist, "middle")
    15  	err := Wrap(mid, "global")
    16  
    17  	assert.True(t, Is(mid, os.ErrNotExist))
    18  	assert.True(t, Is(err, os.ErrNotExist))
    19  }