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

Function TestIssue6458

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

Source from the content-addressed store, hash-verified

233}
234
235func TestIssue6458(t *testing.T) {
236 type Foo struct {
237 M json.RawMessage
238 }
239 x := Foo{json.RawMessage(`"foo"`)}
240
241 b, err := json.Marshal(&x)
242 if err != nil {
243 t.Fatal(err)
244 }
245 if want := `{"M":"foo"}`; string(b) != want {
246 t.Errorf("Marshal(&x) = %#q; want %#q", b, want)
247 }
248
249 b, err = json.Marshal(x)
250 if err != nil {
251 t.Fatal(err)
252 }
253
254 if want := `{"M":"foo"}`; string(b) != want {
255 t.Errorf("Marshal(x) = %#q; want %#q", b, want)
256 }
257}
258
259func TestHTMLEscape(t *testing.T) {
260 var b, want bytes.Buffer

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…