From 548d4eed95da629bf1039cf3d090762e9398ae18 Mon Sep 17 00:00:00 2001 From: Alexander Neumann Date: Wed, 26 Apr 2017 20:47:15 +0200 Subject: [PATCH] Correct backend test for len = 0 --- src/restic/backend/test/tests.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/restic/backend/test/tests.go b/src/restic/backend/test/tests.go index fd32e0826..b2ee5e7da 100644 --- a/src/restic/backend/test/tests.go +++ b/src/restic/backend/test/tests.go @@ -249,7 +249,13 @@ func TestLoad(t testing.TB) { continue } - if l <= len(d) && len(buf) != l { + if l == 0 && len(buf) != len(d) { + t.Errorf("Load(%d, %d) wrong number of bytes read: want %d, got %d", l, o, len(d), len(buf)) + rd.Close() + continue + } + + if l > 0 && l <= len(d) && len(buf) != l { t.Errorf("Load(%d, %d) wrong number of bytes read: want %d, got %d", l, o, l, len(buf)) rd.Close() continue