MCPcopy Create free account
hub / github.com/buger/jsonparser / randJSONString

Function randJSONString

property_test.go:93–101  ·  view source on GitHub ↗
(r *mathrand.Rand)

Source from the content-addressed store, hash-verified

91}
92
93func randJSONString(r *mathrand.Rand) string {
94 var choices = []string{
95 "", "hello", "world", "foo bar", "unicode: \u00e9\u00e8\u00ea",
96 "quote\"inside", "back\\slash", "tab\there", "newline\nhere",
97 "path/with/slashes", "123", "true", "null", "{nested}",
98 "emoji\u2764", "café", "Zürich",
99 }
100 return choices[r.Intn(len(choices))]
101}
102
103// randomObjectJSONBytes returns marshaled JSON for a random top-level object
104// along with the map so tests can predict values.

Callers 1

randomJSONValueFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected