(t *testing.T, str string)
| 2558 | } |
| 2559 | |
| 2560 | func 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 | |
| 2574 | func TestJSONString(t *testing.T) { |
| 2575 | testJSONString(t, "hello") |
no test coverage detected
searching dependent graphs…