MCPcopy
hub / github.com/tidwall/gjson / testJSONString

Function testJSONString

gjson_test.go:2560–2572  ·  view source on GitHub ↗
(t *testing.T, str string)

Source from the content-addressed store, hash-verified

2558}
2559
2560func testJSONString(t *testing.T, str string) {
2561 gjsonString := string(AppendJSONString(nil, str))
2562 data, err := goJSONMarshal(str)
2563 if err != nil {
2564 panic(123)
2565 }
2566 goString := string(data)
2567 if gjsonString != goString {
2568 t.Fatal(strconv.Quote(str) + "\n\t" +
2569 gjsonString + "\n\t" +
2570 goString + "\n\t<<< MISMATCH >>>")
2571 }
2572}
2573
2574func TestJSONString(t *testing.T) {
2575 testJSONString(t, "hello")

Callers 1

TestJSONStringFunction · 0.85

Calls 2

AppendJSONStringFunction · 0.85
goJSONMarshalFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…