mirror of
https://github.com/restic/restic.git
synced 2026-10-13 21:47:12 +00:00
Major restructure, bundle blobs
This commit also breaks the repository format.
This commit is contained in:
1 parent
b836da1980
commit
60a0fe8349
29 files changed
+937
-1123
No files matched your search
@@ -8,6 +8,7 @@ import (
|
||||
"testing"
|
||||
|
||||
"github.com/restic/restic"
|
||||
"github.com/restic/restic/pack"
|
||||
. "github.com/restic/restic/test"
|
||||
)
|
||||
|
||||
@@ -91,3 +92,26 @@ func TestNodeComparison(t *testing.T) {
|
||||
n2.Size -= 1
|
||||
Assert(t, !node.Equals(n2), "nodes are equal")
|
||||
}
|
||||
|
||||
func TestLoadTree(t *testing.T) {
|
||||
server := SetupBackend(t)
|
||||
defer TeardownBackend(t, server)
|
||||
key := SetupKey(t, server, "geheim")
|
||||
server.SetKey(key)
|
||||
|
||||
// save tree
|
||||
tree := restic.NewTree()
|
||||
id, err := server.SaveJSON(pack.Tree, tree)
|
||||
OK(t, err)
|
||||
|
||||
// save packs
|
||||
OK(t, server.Flush())
|
||||
|
||||
// load tree again
|
||||
tree2, err := restic.LoadTree(server, id)
|
||||
OK(t, err)
|
||||
|
||||
Assert(t, tree.Equals(tree2),
|
||||
"trees are not equal: want %v, got %v",
|
||||
tree, tree2)
|
||||
}
|
||||
Reference in new issue
Block a user