1
mirror of https://github.com/rclone/rclone synced 2024-11-27 05:23:40 +01:00
rclone/lib/readers/error_test.go
Nick Craig-Wood e43b5ce5e5 Remove github.com/pkg/errors and replace with std library version
This is possible now that we no longer support go1.12 and brings
rclone into line with standard practices in the Go world.

This also removes errors.New and errors.Errorf from lib/errors and
prefers the stdlib errors package over lib/errors.
2021-11-07 11:53:30 +00:00

19 lines
289 B
Go

package readers
import (
"errors"
"testing"
"github.com/stretchr/testify/assert"
)
func TestErrorReader(t *testing.T) {
errRead := errors.New("boom")
r := ErrorReader{errRead}
buf := make([]byte, 16)
n, err := r.Read(buf)
assert.Equal(t, errRead, err)
assert.Equal(t, 0, n)
}