MCPcopy Create free account
hub / github.com/github/gh-aw / TestMarshalSorted_EmptyContainers

Function TestMarshalSorted_EmptyContainers

pkg/parser/frontmatter_hash_test.go:37–53  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

35}
36
37func TestMarshalSorted_EmptyContainers(t *testing.T) {
38 tests := []struct {
39 name string
40 input any
41 expected string
42 }{
43 {"empty object", map[string]any{}, "{}"},
44 {"empty array", []any{}, "[]"},
45 }
46
47 for _, tt := range tests {
48 t.Run(tt.name, func(t *testing.T) {
49 result := marshalSorted(tt.input)
50 assert.Equal(t, tt.expected, result, "Should marshal empty container correctly")
51 })
52 }
53}
54
55func TestMarshalSorted_SortedKeys(t *testing.T) {
56 input := map[string]any{

Callers

nothing calls this directly

Calls 2

marshalSortedFunction · 0.70
RunMethod · 0.45

Tested by

no test coverage detected