aboutsummaryrefslogtreecommitdiff
path: root/repo_test.go
diff options
context:
space:
mode:
authorn-peugnet <n.peugnet@free.fr>2021-09-09 14:01:00 +0200
committern-peugnet <n.peugnet@free.fr>2021-09-09 14:01:00 +0200
commit1809540dc87c665cafcd6daf514b39b4a17e483f (patch)
tree61cd19f81988d245697fbb40a7462131968ee3a8 /repo_test.go
parent27cf33b15ee5c028f4816607c034df68adf7df4f (diff)
downloaddna-backup-1809540dc87c665cafcd6daf514b39b4a17e483f.tar.gz
dna-backup-1809540dc87c665cafcd6daf514b39b4a17e483f.zip
remove merge and extract tempchunks
Diffstat (limited to 'repo_test.go')
-rw-r--r--repo_test.go17
1 files changed, 1 insertions, 16 deletions
diff --git a/repo_test.go b/repo_test.go
index 07af682..29282bc 100644
--- a/repo_test.go
+++ b/repo_test.go
@@ -159,21 +159,6 @@ func TestLoadChunks(t *testing.T) {
}
}
-func TestExtractNewChunks(t *testing.T) {
- repo := NewRepo("")
- chunks := []Chunk{
- &TempChunk{Value: []byte{'a'}},
- &LoadedChunk{Id: &ChunkId{0, 0}},
- &TempChunk{Value: []byte{'b'}},
- &TempChunk{Value: []byte{'c'}},
- &LoadedChunk{Id: &ChunkId{0, 1}},
- }
- newChunks := extractTempChunks(repo.mergeTempChunks(chunks))
- assertLen(t, 2, newChunks, "New chunks:")
- assertChunkContent(t, []byte{'a'}, newChunks[0], "First new:")
- assertChunkContent(t, []byte{'b', 'c'}, newChunks[1], "Second New:")
-}
-
func TestStoreLoadFiles(t *testing.T) {
resultDir := t.TempDir()
dataDir := path.Join("testdata", "logs")
@@ -233,7 +218,7 @@ func TestBsdiff(t *testing.T) {
// Read new data
reader := getDataStream(dataDir, concatFiles)
recipe := repo.matchStream(reader, newVersion)
- newChunks := extractDeltaChunks(repo.mergeTempChunks(recipe))
+ newChunks := extractDeltaChunks(recipe)
assertLen(t, 2, newChunks, "New delta chunks:")
for _, c := range newChunks {
log.Println("Patch size:", len(c.Patch))