From 2bec99dc6f4342c8789a8bcec4ac26071d859930 Mon Sep 17 00:00:00 2001 From: Michael Eischer Date: Sat, 19 Aug 2023 20:04:22 +0200 Subject: [PATCH] master_index: fix inconsistent length blob length in test Two blobs with the same hash must always have the same content length. --- internal/index/master_index_test.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/internal/index/master_index_test.go b/internal/index/master_index_test.go index 45286e89c..5260a11a0 100644 --- a/internal/index/master_index_test.go +++ b/internal/index/master_index_test.go @@ -43,9 +43,10 @@ func TestMasterIndex(t *testing.T) { blob12a := restic.PackedBlob{ PackID: restic.NewRandomID(), Blob: restic.Blob{ - BlobHandle: bhInIdx12, - Length: uint(crypto.CiphertextLength(123)), - Offset: 110, + BlobHandle: bhInIdx12, + Length: uint(crypto.CiphertextLength(123)), + Offset: 110, + UncompressedLength: 80, }, } @@ -116,7 +117,7 @@ func TestMasterIndex(t *testing.T) { size, found = mIdx.LookupSize(bhInIdx12) rtest.Equals(t, true, found) - rtest.Equals(t, uint(123), size) + rtest.Equals(t, uint(80), size) // test not in index found = mIdx.Has(restic.BlobHandle{ID: restic.NewRandomID(), Type: restic.TreeBlob})