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

Function TestParenQueries

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

Source from the content-addressed store, hash-verified

1732}
1733
1734func TestParenQueries(t *testing.T) {
1735 json := `{
1736 "friends": [{"a":10},{"a":20},{"a":30},{"a":40}]
1737 }`
1738 assert(t, Get(json, "friends.#(a>9)#|#").Int() == 4)
1739 assert(t, Get(json, "friends.#(a>10)#|#").Int() == 3)
1740 assert(t, Get(json, "friends.#(a>40)#|#").Int() == 0)
1741}
1742
1743func TestSubSelectors(t *testing.T) {
1744 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…