aboutsummaryrefslogtreecommitdiff
path: root/backup/restore_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'backup/restore_test.go')
-rw-r--r--backup/restore_test.go18
1 files changed, 18 insertions, 0 deletions
diff --git a/backup/restore_test.go b/backup/restore_test.go
index 1a88e5f..9e6e525 100644
--- a/backup/restore_test.go
+++ b/backup/restore_test.go
@@ -107,3 +107,21 @@ func TestRestoreDir(t *testing.T) {
}))
})(t, root)
}
+
+func TestRestoreLargeFile(t *testing.T) {
+ s := storage.NewMemoryStorage()
+ s.Set(objid_largefile_blob0, objects.OTBlob, obj_largefile_blob0)
+ s.Set(objid_largefile_blob1, objects.OTBlob, obj_largefile_blob1)
+ s.Set(objid_largefile, objects.OTFile, obj_largefile)
+
+ buf := new(bytes.Buffer)
+
+ if err := RestoreFile(s, objid_largefile, buf); err != nil {
+ t.Fatalf("Unexpected error while restoring file: %s", err)
+ }
+
+ have := buf.Bytes()
+ if !bytes.Equal(have, content_largefile) {
+ t.Errorf("Unexpected restoration result: %s", have)
+ }
+}