(r *mathrand.Rand)
| 90 | } |
| 91 | |
| 92 | func 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. |