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

Function TestIssue21

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

Source from the content-addressed store, hash-verified

914}
915
916func TestIssue21(t *testing.T) {
917 json := `{ "Level1Field1":3,
918 "Level1Field4":4,
919 "Level1Field2":{ "Level2Field1":[ "value1", "value2" ],
920 "Level2Field2":{ "Level3Field1":[ { "key1":"value1" } ] } } }`
921 paths := []string{"Level1Field1", "Level1Field2.Level2Field1",
922 "Level1Field2.Level2Field2.Level3Field1", "Level1Field4"}
923 expected := []string{"3", `[ "value1", "value2" ]`,
924 `[ { "key1":"value1" } ]`, "4"}
925 t.Run("SingleMany", func(t *testing.T) {
926 testMany(t, json, paths,
927 expected)
928 })
929}
930
931func TestRandomMany(t *testing.T) {
932 var lstr string

Callers

nothing calls this directly

Calls 1

testManyFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…