diff options
| author | Marin Ivanov <[email protected]> | 2022-08-15 06:16:55 +0300 |
|---|---|---|
| committer | Marin Ivanov <[email protected]> | 2022-08-15 06:16:55 +0300 |
| commit | f8fc14b2e0a10c64de0bd87f831ebde4f705b79b (patch) | |
| tree | 5477a9fbca3be41a7e3ecb9a73eb37ae51b5fbfb /fs_test.go | |
| parent | 88951333595a63af7bdcc91e1519be38cfbce82a (diff) | |
Optimize for files larger than 16MiB
Diffstat (limited to 'fs_test.go')
| -rw-r--r-- | fs_test.go | 18 |
1 files changed, 18 insertions, 0 deletions
@@ -1,6 +1,7 @@ package s3 import ( + cryptorand "crypto/rand" "errors" "io" "os" @@ -98,6 +99,23 @@ func TestFsWriteError(t *testing.T) { is.Equal(err, os.ErrNotExist) } +func TestFsWrite17MB(t *testing.T) { + is := is.New(t) + afs, cleanup := newTestAfs() + defer cleanup() + + f, err := afs.Fs.Create("dir/file") + is.NoErr(err) + r := io.LimitReader(cryptorand.Reader, 17*(1<<20)) + _, err = io.Copy(f, r) + is.NoErr(err) + err = f.Close() + is.NoErr(err) + info, err := afs.Stat("dir/file") + is.NoErr(err) + is.Equal(info.Size(), int64(17*(1<<20))) +} + func TestFsStat(t *testing.T) { is := is.New(t) afs, cleanup := newTestAfs() |
