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

Function randJSONString

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

Source from the content-addressed store, hash-verified

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

Callers 1

randomJSONValueFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected