MCPcopy Index your code
hub / github.com/tidwall/gjson / TestEncodedQueryString

Function TestEncodedQueryString

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

Source from the content-addressed store, hash-verified

2118}
2119
2120func TestEncodedQueryString(t *testing.T) {
2121 json := `{
2122 "friends": [
2123 {"first": "Dale", "last": "Mur\nphy", "age": 44},
2124 {"first": "Roger", "last": "Craig", "age": 68},
2125 {"first": "Jane", "last": "Murphy", "age": 47}
2126 ]
2127 }`
2128 assert(t, Get(json, `friends.#(last=="Mur\nphy").age`).Int() == 44)
2129 assert(t, Get(json, `friends.#(last=="Murphy").age`).Int() == 47)
2130}
2131
2132func TestTildeQueries(t *testing.T) {
2133 json := `{

Callers

nothing calls this directly

Calls 3

assertFunction · 0.85
GetFunction · 0.85
IntMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…