Skip to content

Commit f0e9dcc

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

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
@@ -412,6 +412,16 @@ func TestGenerateSHAFromSecret(t *testing.T) {
412412
data2: map[string][]byte{"key2": []byte("value2"), "key1": []byte("value1")},
413413
expectedSHAMatch: true,
414414
},
415+
{
416+
name: "different keys with the same concatenated result but should not match",
417+
data1: map[string][]byte{
418+
"key1": []byte("=value1"),
419+
},
420+
data2: map[string][]byte{
421+
"key1=": []byte("value1"),
422+
},
423+
expectedSHAMatch: false,
424+
},
415425
}
416426

417427
for _, test := range tests {

0 commit comments

Comments
 (0)