func TestIsErrNotFound(t *testing.T) { testErrFn(t, IsErrNotFound, []errorCase{ {nil, false}, {errors.New("error"), false}, {cp.NewError(cp.ErrBadPath, "bad path"), false}, {cp.NewError(cp.ErrNoEnt, "not found"), true}, {NewError(ErrNotFound, "not found"), true}, }) }
func TestIsErrInvalidPort(t *testing.T) { testErrFn(t, IsErrInvalidPort, []errorCase{ {nil, false}, {errors.New("error"), false}, {cp.NewError(cp.ErrBadPath, "bad path"), false}, {NewError(ErrInvalidPort, "invalid port"), true}, }) }
func TestIsErrInsClaimed(t *testing.T) { testErrFn(t, IsErrInsClaimed, []errorCase{ {nil, false}, {errors.New("error"), false}, {cp.NewError(cp.ErrBadPath, "bad path"), false}, {NewError(ErrInsClaimed, "claimed"), true}, }) }
func TestIsErrConflict(t *testing.T) { testErrFn(t, IsErrConflict, []errorCase{ {nil, false}, {errors.New("error"), false}, {cp.NewError(cp.ErrBadPath, "bad path"), false}, {NewError(ErrConflict, "conflict"), true}, }) }
func TestIsErrInvalidState(t *testing.T) { testErrFn(t, IsErrInvalidState, []errorCase{ {nil, false}, {errors.New("error"), false}, {cp.NewError(cp.ErrBadPath, "bad path"), false}, {ErrInvalidState, true}, {NewError(ErrInvalidState, "invalid state"), true}, }) }