mirror of
https://github.com/sourcegraph/sourcegraph.git
synced 2026-02-06 17:11:49 +00:00
21 lines
446 B
Go
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")))
|
|
}
|