From 7a08426869abd4c0bcfe09081c337bdb2bab909a Mon Sep 17 00:00:00 2001 From: Markus Lehtonen Date: Mon, 14 Mar 2022 13:07:33 +0200 Subject: [PATCH] repo: fix repo merge unit test Enable asserts that accidentally excluded from normal test flow. Signed-off-by: Markus Lehtonen --- pkg/repo/index_test.go | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/pkg/repo/index_test.go b/pkg/repo/index_test.go index 51c31fab7..a75a4177a 100644 --- a/pkg/repo/index_test.go +++ b/pkg/repo/index_test.go @@ -208,14 +208,15 @@ func TestMerge(t *testing.T) { if len(ind1.Entries) != 2 { t.Errorf("Expected 2 entries, got %d", len(ind1.Entries)) - vs := ind1.Entries["dreadnought"] - if len(vs) != 2 { - t.Errorf("Expected 2 versions, got %d", len(vs)) - } - v := vs[0] - if v.Version != "0.2.0" { - t.Errorf("Expected %q version to be 0.2.0, got %s", v.Name, v.Version) - } + } + + vs := ind1.Entries["dreadnought"] + if len(vs) != 2 { + t.Errorf("Expected 2 versions, got %d", len(vs)) + } + + if v := vs[1]; v.Version != "0.2.0" { + t.Errorf("Expected %q version to be 0.2.0, got %s", v.Name, v.Version) } }