Skip to content

Commit 03a1885

Browse files
committed
chore: use deep equal for map comparison
Signed-off-by: Zaki Shaikh <[email protected]>
1 parent e76ae6c commit 03a1885

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

pkg/pipelineascode/pipelineascode_test.go

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -777,13 +777,14 @@ func TestGetExecutionOrderPatch(t *testing.T) {
777777
for _, tt := range tests {
778778
t.Run(tt.name, func(t *testing.T) {
779779
result := getExecutionOrderPatch(tt.order)
780-
m, ok := result["metadata"].(map[string]any)
781-
assert.Assert(t, ok, "metadata should be present in result")
782-
783-
anns, ok := m["annotations"].(map[string]string)
784-
assert.Assert(t, ok, "annotations should be present in metadata")
785-
786-
assert.Equal(t, anns[keys.ExecutionOrder], tt.want, "execution order should match")
780+
expected := map[string]any{
781+
"metadata": map[string]any{
782+
"annotations": map[string]string{
783+
keys.ExecutionOrder: tt.want,
784+
},
785+
},
786+
}
787+
assert.DeepEqual(t, expected, result)
787788
})
788789
}
789790
}

0 commit comments

Comments
 (0)