MCPcopy
hub / github.com/tidwall/gjson / TestIsArrayIsObject

Function TestIsArrayIsObject

gjson_test.go:289–304  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

287}
288
289func TestIsArrayIsObject(t *testing.T) {
290 mtok := get(basicJSON, "loggy")
291 assert(t, mtok.IsObject())
292 assert(t, !mtok.IsArray())
293
294 mtok = get(basicJSON, "loggy.programmers")
295 assert(t, !mtok.IsObject())
296 assert(t, mtok.IsArray())
297
298 mtok = get(basicJSON, `loggy.programmers.#[tag="good"]#.firstName`)
299 assert(t, mtok.IsArray())
300
301 mtok = get(basicJSON, `loggy.programmers.0.firstName`)
302 assert(t, !mtok.IsObject())
303 assert(t, !mtok.IsArray())
304}
305
306func TestPlus53BitInts(t *testing.T) {
307 json := `{"IdentityData":{"GameInstanceId":634866135153775564}}`

Callers

nothing calls this directly

Calls 4

getFunction · 0.85
assertFunction · 0.85
IsObjectMethod · 0.80
IsArrayMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…