aboutsummaryrefslogtreecommitdiff
path: root/repo_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'repo_test.go')
-rw-r--r--repo_test.go10
1 files changed, 8 insertions, 2 deletions
diff --git a/repo_test.go b/repo_test.go
index 8c07c5b..d9c938d 100644
--- a/repo_test.go
+++ b/repo_test.go
@@ -4,6 +4,7 @@ import (
"bytes"
"io"
"io/ioutil"
+ "log"
"os"
"path"
"testing"
@@ -179,8 +180,8 @@ func TestBsdiff(t *testing.T) {
versions := repo.loadVersions()
go repo.loadChunks(versions, oldChunks)
go concatFiles(files, writer)
- hashes := hashChunks(oldChunks)
- recipe := repo.matchStream(reader, hashes)
+ fingerprints, sketches := hashChunks(oldChunks)
+ recipe := repo.matchStream(reader, fingerprints)
buff := new(bytes.Buffer)
r2, _ := recipe[2].Reader()
r0, _ := recipe[0].Reader()
@@ -191,6 +192,11 @@ func TestBsdiff(t *testing.T) {
if len(buff.Bytes()) >= chunkSize {
t.Errorf("Bsdiff of chunk is too large: %d", len(buff.Bytes()))
}
+ newChunks := extractNewChunks(recipe)
+ log.Println("Checking new chunks:", len(newChunks[0]))
+ for _, c := range newChunks {
+ findSimilarChunks(c, sketches)
+ }
os.Remove(addedFile)
}