mirror of
https://github.com/rclone/rclone.git
synced 2024-11-27 02:45:16 +01:00
19 lines
304 B
Go
19 lines
304 B
Go
package readers
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/pkg/errors"
|
|
"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)
|
|
}
|