From 763c6b985da74078e8683fa83b3f599619deb00d Mon Sep 17 00:00:00 2001 From: n-peugnet Date: Wed, 6 Oct 2021 14:46:38 +0200 Subject: use repo deltacodec for recipe and files this should not only be more efficient in space but also in time drop old Commit and Restore tests that do not use compression --- repo/repo_test.go | 38 ++++---------------------------------- 1 file changed, 4 insertions(+), 34 deletions(-) (limited to 'repo/repo_test.go') diff --git a/repo/repo_test.go b/repo/repo_test.go index 0d26ccd..36cc1bd 100644 --- a/repo/repo_test.go +++ b/repo/repo_test.go @@ -337,27 +337,13 @@ func TestBsdiff(t *testing.T) { } } -func TestCommit(t *testing.T) { - dest := t.TempDir() - source := filepath.Join("testdata", "logs") - expected := filepath.Join("testdata", "repo_8k") - repo := NewRepo(dest) - repo.patcher = delta.Bsdiff{} - repo.differ = delta.Bsdiff{} - repo.chunkReadWrapper = utils.NopReadWrapper - repo.chunkWriteWrapper = utils.NopWriteWrapper - - repo.Commit(source) - assertSameTree(t, assertCompatibleRepoFile, expected, dest, "Commit") -} - func TestCommitZlib(t *testing.T) { dest := t.TempDir() source := filepath.Join("testdata", "logs") expected := filepath.Join("testdata", "repo_8k_zlib") repo := NewRepo(dest) - repo.patcher = delta.Bsdiff{} - repo.differ = delta.Bsdiff{} + repo.patcher = delta.Fdelta{} + repo.differ = delta.Fdelta{} repo.chunkReadWrapper = utils.ZlibReader repo.chunkWriteWrapper = utils.ZlibWriter @@ -365,22 +351,6 @@ func TestCommitZlib(t *testing.T) { assertSameTree(t, assertCompatibleRepoFile, expected, dest, "Commit") } -func TestRestore(t *testing.T) { - logger.SetLevel(2) - defer logger.SetLevel(4) - dest := t.TempDir() - source := filepath.Join("testdata", "repo_8k") - expected := filepath.Join("testdata", "logs") - repo := NewRepo(source) - repo.patcher = delta.Bsdiff{} - repo.differ = delta.Bsdiff{} - repo.chunkReadWrapper = utils.NopReadWrapper - repo.chunkWriteWrapper = utils.NopWriteWrapper - - repo.Restore(dest) - assertSameTree(t, testutils.AssertSameFile, expected, dest, "Restore") -} - func TestRestoreZlib(t *testing.T) { logger.SetLevel(2) defer logger.SetLevel(4) @@ -388,8 +358,8 @@ func TestRestoreZlib(t *testing.T) { source := filepath.Join("testdata", "repo_8k_zlib") expected := filepath.Join("testdata", "logs") repo := NewRepo(source) - repo.patcher = delta.Bsdiff{} - repo.differ = delta.Bsdiff{} + repo.patcher = delta.Fdelta{} + repo.differ = delta.Fdelta{} repo.chunkReadWrapper = utils.ZlibReader repo.chunkWriteWrapper = utils.ZlibWriter -- cgit v1.2.3