mirror of
https://github.com/rclone/rclone.git
synced 2025-02-07 14:10:09 +01:00
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.
19 lines
289 B
Go
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)
|
|
}
|