diff options
author | n-peugnet <n.peugnet@free.fr> | 2021-09-14 16:43:29 +0200 |
---|---|---|
committer | n-peugnet <n.peugnet@free.fr> | 2021-09-14 17:01:07 +0200 |
commit | 4ca1c3bbb76834c69b0d8e63c921ca3548f529ac (patch) | |
tree | e9414a1c47ab0c379b382bba99b64e350a44aa7d /repo_test.go | |
parent | 1b29f7dafc233ed893d8f35e5edbb0c2e357d55d (diff) | |
download | dna-backup-4ca1c3bbb76834c69b0d8e63c921ca3548f529ac.tar.gz dna-backup-4ca1c3bbb76834c69b0d8e63c921ca3548f529ac.zip |
add load/store sketches+fingerprints & store them
Fix corresponding Commit tests by adding sketches and fingerprints files in
repo_8k and repo_8k_zlib.
Also enhance CommitTests by checking recipe files
Diffstat (limited to 'repo_test.go')
-rw-r--r-- | repo_test.go | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/repo_test.go b/repo_test.go index b16ddc6..f6f6edd 100644 --- a/repo_test.go +++ b/repo_test.go @@ -319,6 +319,7 @@ func assertSameTree(t *testing.T, apply func(t *testing.T, expected string, actu func assertCompatibleRepoFile(t *testing.T, expected string, actual string, prefix string) { if filepath.Base(expected) == filesName { + // Filelist file eFiles := loadFileList(expected) aFiles := loadFileList(actual) assertLen(t, len(eFiles), aFiles, prefix) @@ -329,8 +330,23 @@ func assertCompatibleRepoFile(t *testing.T, expected string, actual string, pref } } } else if filepath.Base(expected) == recipeName { - // TODO: check recipies equality + // Recipe file + eRecipe := loadRecipe(expected) + aRecipe := loadRecipe(actual) + assertLen(t, len(eRecipe), aRecipe, prefix) + for i, eChunk := range eRecipe { + if reflect.DeepEqual(eChunk, aRecipe[i]) { + continue + } else { + t.Fatal(prefix, "chunk do not match:", aRecipe[i], ", expected", eChunk) + } + } + } else if filepath.Base(expected) == sketchesName { + // TODO: check Sketches file + } else if filepath.Base(expected) == fingerprintsName { + // TODO: check Fingerprints file } else { + // Chunk content file assertSameFile(t, expected, actual, prefix) } } |