From 2f20511f442cecc764c817709c4358a149984766 Mon Sep 17 00:00:00 2001 From: n-peugnet Date: Wed, 15 Sep 2021 15:06:30 +0200 Subject: add storeWorker and use it to store chunk content and hashes --- repo_test.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'repo_test.go') diff --git a/repo_test.go b/repo_test.go index f6f6edd..cf88224 100644 --- a/repo_test.go +++ b/repo_test.go @@ -230,11 +230,13 @@ func TestBsdiff(t *testing.T) { // Load previously stored chunks oldChunks := make(chan IdentifiedChunk, 16) versions := repo.loadVersions() - newVersion := len(versions) go repo.loadChunks(versions, oldChunks) repo.hashChunks(oldChunks) // Read new data + newVersion := len(versions) + newPath := filepath.Join(repo.path, fmt.Sprintf(versionFmt, newVersion)) + os.MkdirAll(newPath, 0775) reader := getDataStream(dataDir, concatFiles) recipe := repo.matchStream(reader, newVersion) newChunks := extractDeltaChunks(recipe) @@ -341,10 +343,8 @@ func assertCompatibleRepoFile(t *testing.T, expected string, actual string, pref 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 if filepath.Base(expected) == hashesName { + // TODO: check Hashes file } else { // Chunk content file assertSameFile(t, expected, actual, prefix) -- cgit v1.2.3