(t *testing.T)
| 11 | ) |
| 12 | |
| 13 | func 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 | |
| 28 | func TestOmitEmptyAll(t *testing.T) { |
| 29 | var o OmitAll |
nothing calls this directly
no outgoing calls
no test coverage detected
searching dependent graphs…