summaryrefslogtreecommitdiff
path: root/fs_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'fs_test.go')
-rw-r--r--fs_test.go18
1 files changed, 18 insertions, 0 deletions
diff --git a/fs_test.go b/fs_test.go
index 550c199..7e9765c 100644
--- a/fs_test.go
+++ b/fs_test.go
@@ -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()