(t *testing.T, size int64)
| 965 | } |
| 966 | |
| 967 | func (r *run) randomReader(t *testing.T, size int64) io.ReadCloser { |
| 968 | chunk := int64(1024) |
| 969 | cnt := size / chunk |
| 970 | left := size % chunk |
| 971 | f, err := os.CreateTemp("", "rclonecache-tempfile") |
| 972 | require.NoError(t, err) |
| 973 | |
| 974 | for range int(cnt) { |
| 975 | data := randStringBytes(int(chunk)) |
| 976 | _, _ = f.Write(data) |
| 977 | } |
| 978 | data := randStringBytes(int(left)) |
| 979 | _, _ = f.Write(data) |
| 980 | _, _ = f.Seek(int64(0), io.SeekStart) |
| 981 | r.tempFiles = append(r.tempFiles, f) |
| 982 | |
| 983 | return f |
| 984 | } |
| 985 | |
| 986 | func (r *run) writeRemoteString(t *testing.T, f fs.Fs, remote, content string) { |
| 987 | r.writeRemoteBytes(t, f, remote, []byte(content)) |
no test coverage detected