MCPcopy
hub / github.com/pquerna/ffjson / TestWriteJsonString

Function TestWriteJsonString

fflib/v1/jsonstring_test.go:25–38  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

23)
24
25func TestWriteJsonString(t *testing.T) {
26 var buf bytes.Buffer
27 WriteJsonString(&buf, "foo")
28 if string(buf.Bytes()) != `"foo"` {
29 t.Fatalf("Expected: %v\nGot: %v", `"foo"`, string(buf.Bytes()))
30 }
31
32 buf.Reset()
33 WriteJsonString(&buf, `f"oo`)
34 if string(buf.Bytes()) != `"f\"oo"` {
35 t.Fatalf("Expected: %v\nGot: %v", `"f\"oo"`, string(buf.Bytes()))
36 }
37 // TODO(pquerna): all them important tests.
38}

Callers

nothing calls this directly

Calls 4

BytesMethod · 0.95
ResetMethod · 0.95
WriteJsonStringFunction · 0.85
FatalfMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…