Skip to content

Commit

Permalink
[pkg/ottl] open-telemetry#31543 Add additional negative unit tests fo…
Browse files Browse the repository at this point in the history
…r Base64Decode
  • Loading branch information
DougManton committed Mar 14, 2024
1 parent 924ecee commit 0d811ce
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions pkg/ottl/ottlfuncs/func_base64decode_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,16 @@ func Test_Base64DecodeError(t *testing.T) {
value: nil,
expectedError: "expected string but got nil",
},
{
name: "not-base64-string",
value: "!@#$%^&*()_+",
expectedError: "illegal base64 data at input byte",
},
{
name: "missing-base64-padding",
value: "cmVtb3ZlZCBwYWRkaW5nCg",
expectedError: "illegal base64 data at input byte",
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
Expand Down

0 comments on commit 0d811ce

Please sign in to comment.