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

Function TestAnonymousNonstruct

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

Source from the content-addressed store, hash-verified

152}
153
154func TestAnonymousNonstruct(t *testing.T) {
155 var i IntType = 11
156 a := MyStruct{i}
157 const want = `{"IntType":11}`
158
159 b, err := json.Marshal(a)
160 if err != nil {
161 t.Fatalf("Marshal: %v", err)
162 }
163 if got := string(b); got != want {
164 t.Errorf("got %q, want %q", got, want)
165 }
166}
167
168// Issue 5245.
169func TestEmbeddedBug(t *testing.T) {

Callers

nothing calls this directly

Calls 1

FatalfMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…