Skip to content

Commit

Permalink
feat: test coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
CeerDecy committed Dec 6, 2024
1 parent 9489a67 commit 464712a
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -212,13 +212,14 @@ func Test_ParseAnnotationFromEnv(t *testing.T) {
}
}

func TestMerge(t *testing.T) {
func TestMergeStructValue(t *testing.T) {
want := `{"container":{"securityContext":{"runAsUser":0,"runAsGroup":0}}}`
snippet := diceyml.K8SSnippet{}
values := map[string]any{
"RunAsUser": new(int64),
"RunAsGroup": new(int64),
}
MergeStructValue(&snippet, values, "K8SSnippet", "Container", "SecurityContext")
marshal, _ := json.Marshal(snippet)
fmt.Println(string(marshal))
assert.Equal(t, want, string(marshal))
}

0 comments on commit 464712a

Please sign in to comment.