Skip to content

Commit

Permalink
fix: add unit test to show failures in current sha logic
Browse files Browse the repository at this point in the history
Signed-off-by: Anish Ramasekar <anish.ramasekar@gmail.com>
  • Loading branch information
aramase committed Oct 25, 2024
1 parent 7f00839 commit b94492d
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions pkg/util/secretutil/secret_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -411,6 +411,16 @@ func TestGenerateSHAFromSecret(t *testing.T) {
data2: map[string][]byte{"key2": []byte("value2"), "key1": []byte("value1")},
expectedSHAMatch: true,
},
{
name: "different keys with the same concatenated result but should not match",
data1: map[string][]byte{
"key1": []byte("=value1"),
},
data2: map[string][]byte{
"key1=": []byte("value1"),
},
expectedSHAMatch: false,
},
}

for _, test := range tests {
Expand Down

0 comments on commit b94492d

Please sign in to comment.