mirror of
https://github.com/sourcegraph/sourcegraph.git
synced 2026-02-06 19:21:50 +00:00
Use it in the 1 place it seemed obvious. I have other changes where it will be used in more places. This helps standardize our codebase. ## Test plan CI
23 lines
423 B
Go
23 lines
423 B
Go
package database
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/sourcegraph/sourcegraph/internal/errcode"
|
|
)
|
|
|
|
func TestResourceNotFoundError(t *testing.T) {
|
|
err := resourceNotFoundError{"foo"}
|
|
if want := "foo not found"; err.Error() != want {
|
|
t.Errorf("got %q, want %q", err, want)
|
|
}
|
|
|
|
if !errcode.IsNotFound(resourceNotFoundError{"foo"}) {
|
|
t.Fatal()
|
|
}
|
|
if !errcode.IsNotFound(&resourceNotFoundError{"foo"}) {
|
|
t.Fatal()
|
|
}
|
|
|
|
}
|