File: error_test.go

package info (click to toggle)
rclone 1.60.1%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 34,820 kB
  • sloc: sh: 957; xml: 857; python: 655; javascript: 612; makefile: 264; ansic: 101; php: 74
file content (18 lines) | stat: -rw-r--r-- 289 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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)
}