MCPcopy Create free account
hub / github.com/devaccuracy/ledgerforge / TestToMap_Struct

Function TestToMap_Struct

internal/search/search_test.go:188–202  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

186}
187
188func TestToMap_Struct(t *testing.T) {
189 input := struct {
190 Name string `json:"name"`
191 Age int `json:"age"`
192 }{
193 Name: "test",
194 Age: 25,
195 }
196
197 result, err := toMap(input)
198
199 assert.NoError(t, err)
200 assert.Equal(t, "test", result["name"])
201 assert.Equal(t, float64(25), result["age"]) // JSON unmarshals numbers as float64
202}
203
204func TestGetDefaultValue(t *testing.T) {
205 tests := []struct {

Callers

nothing calls this directly

Calls 1

toMapFunction · 0.85

Tested by

no test coverage detected