MCPcopy Index your code
hub / github.com/valyala/quicktemplate / TestAppendJSONString

Function TestAppendJSONString

jsonstring_test.go:9–24  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

7)
8
9func TestAppendJSONString(t *testing.T) {
10 testAppendJSONString(t, ``)
11 testAppendJSONString(t, `f`)
12 testAppendJSONString(t, `"`)
13 testAppendJSONString(t, `<`)
14 testAppendJSONString(t, "\x00\n\r\t\b\f"+`"\`)
15 testAppendJSONString(t, `"foobar`)
16 testAppendJSONString(t, `foobar"`)
17 testAppendJSONString(t, `foo "bar"
18 baz`)
19 testAppendJSONString(t, `this is a "тест"`)
20 testAppendJSONString(t, `привет test ыва`)
21
22 testAppendJSONString(t, `</script><script>alert('evil')</script>`)
23 testAppendJSONString(t, "\u001b")
24}
25
26func testAppendJSONString(t *testing.T, s string) {
27 expectedResult, err := json.Marshal(s)

Callers

nothing calls this directly

Calls 1

testAppendJSONStringFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…