Skip to content

Commit 990c893

Browse files
committed
fix: add unit test to show failures in current sha logic
Signed-off-by: Anish Ramasekar <[email protected]>
1 parent c0154c9 commit 990c893

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

pkg/util/secretutil/secret_test.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -445,6 +445,16 @@ func TestGenerateSHAFromSecret(t *testing.T) {
445445
data2: map[string][]byte{"key2": []byte("value2"), "key1": []byte("value1")},
446446
expectedSHAMatch: true,
447447
},
448+
{
449+
name: "different keys with the same concatenated result but should not match",
450+
data1: map[string][]byte{
451+
"key1": []byte("=value1"),
452+
},
453+
data2: map[string][]byte{
454+
"key1=": []byte("value1"),
455+
},
456+
expectedSHAMatch: false,
457+
},
448458
}
449459

450460
for _, test := range tests {

0 commit comments

Comments
 (0)