MCPcopy Create free account
hub / github.com/pquerna/ffjson / TestOmitEmpty

Function TestOmitEmpty

tests/encode_test.go:13–26  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

11)
12
13func TestOmitEmpty(t *testing.T) {
14 var o Optionals
15 o.Sw = "something"
16 o.Mr = map[string]interface{}{}
17 o.Mo = map[string]interface{}{}
18
19 got, err := json.MarshalIndent(&o, "", " ")
20 if err != nil {
21 t.Fatal(err)
22 }
23 if got := string(got); got != optionalsExpected {
24 t.Errorf(" got: %s\nwant: %s\n", got, optionalsExpected)
25 }
26}
27
28func TestOmitEmptyAll(t *testing.T) {
29 var o OmitAll

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…