sourcegraph/internal/authz/iface_test.go
2022-02-07 15:03:45 +00:00

21 lines
446 B
Go

package authz
import (
"testing"
"github.com/stretchr/testify/assert"
"github.com/sourcegraph/sourcegraph/lib/errors"
)
func TestErrUnimplementedIs(t *testing.T) {
err := &ErrUnimplemented{Feature: "some feature"}
assert.True(t, err.Is(&ErrUnimplemented{}),
"err.Is(err) should match")
assert.True(t, errors.Is(err, &ErrUnimplemented{}),
"errors.Is(e1, e2) should match")
assert.False(t, err.Is(errors.New("different error")))
}