From d2c2c7bd6ef723e626bd6e68c9bbbd2448ff93cf Mon Sep 17 00:00:00 2001 From: Topi Kettunen Date: Thu, 7 Jan 2021 16:38:50 +0200 Subject: [PATCH] Add tests Signed-off-by: Topi Kettunen --- pkg/repo/chartrepo_test.go | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/pkg/repo/chartrepo_test.go b/pkg/repo/chartrepo_test.go index 7bd563460..22b5eb050 100644 --- a/pkg/repo/chartrepo_test.go +++ b/pkg/repo/chartrepo_test.go @@ -400,4 +400,20 @@ func TestResolveReferenceURL(t *testing.T) { if chartURL != "https://charts.helm.sh/stable/nginx-0.2.0.tgz" { t.Errorf("%s", chartURL) } + + chartURL, err = ResolveReferenceURL("http://localhost:8123/charts/?key=value", "nginx-0.2.0.tgz") + if err != nil { + t.Errorf("%s", err) + } + if chartURL != "http://localhost:8123/charts/nginx-0.2.0.tgz?key=value" { + t.Errorf("%s", chartURL) + } + + chartURL, err = ResolveReferenceURL("http://localhost:8123/charts/?", "nginx-0.2.0.tgz") + if err != nil { + t.Errorf("%s", err) + } + if chartURL != "http://localhost:8123/charts/nginx-0.2.0.tgz" { + t.Errorf("%s", chartURL) + } }