Skip to content

Commit

Permalink
adding test case for comparing with empty key
Browse files Browse the repository at this point in the history
Signed-off-by: Javan lacerda <[email protected]>
  • Loading branch information
javanlacerda committed Jul 30, 2024
1 parent 704ce08 commit 50680d5
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pkg/identity/ciprovider/principal_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 50680d5

Please sign in to comment.