From 50680d55b9c7531d0a3e0596b834e11a28c896ad Mon Sep 17 00:00:00 2001 From: Javan lacerda Date: Tue, 30 Jul 2024 19:38:59 +0000 Subject: [PATCH] adding test case for comparing with empty key Signed-off-by: Javan lacerda --- pkg/identity/ciprovider/principal_test.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkg/identity/ciprovider/principal_test.go b/pkg/identity/ciprovider/principal_test.go index b67bd6041..cf4e10ebe 100644 --- a/pkg/identity/ciprovider/principal_test.go +++ b/pkg/identity/ciprovider/principal_test.go @@ -283,6 +283,11 @@ func TestApplyTemplateOrReplace(t *testing.T) { ExpectedResult: "refs/tags/1.0.0", ExpectErr: false, }, + `Raise error for empty key in comparison`: { + Template: `{{if eq . ""}}foo{{else}}bar{{end}}`, + ExpectedResult: "", + ExpectErr: true, + }, } for name, test := range tests {