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

Function TestIssue38

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

Source from the content-addressed store, hash-verified

349 assert(t, Get(json, "overflow_int64").Int() == -9223372036854775808)
350}
351func TestIssue38(t *testing.T) {
352 // These should not fail, even though the unicode is invalid.
353 Get(`["S3O PEDRO DO BUTI\udf93"]`, "0")
354 Get(`["S3O PEDRO DO BUTI\udf93asdf"]`, "0")
355 Get(`["S3O PEDRO DO BUTI\udf93\u"]`, "0")
356 Get(`["S3O PEDRO DO BUTI\udf93\u1"]`, "0")
357 Get(`["S3O PEDRO DO BUTI\udf93\u13"]`, "0")
358 Get(`["S3O PEDRO DO BUTI\udf93\u134"]`, "0")
359 Get(`["S3O PEDRO DO BUTI\udf93\u1345"]`, "0")
360 Get(`["S3O PEDRO DO BUTI\udf93\u1345asd"]`, "0")
361}
362func TestTypes(t *testing.T) {
363 assert(t, (Result{Type: String}).Type.String() == "String")
364 assert(t, (Result{Type: Number}).Type.String() == "Number")

Callers

nothing calls this directly

Calls 1

GetFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…