(t *testing.T)
| 2614 | } |
| 2615 | |
| 2616 | func TestDeepModifierWithOptions(t *testing.T) { |
| 2617 | rawJson := `{"x":[{"y":[{"z":{"b":1, "c": 2, "a": 3}}]}]}` |
| 2618 | jsonPathExpr := `x.#.y.#.z.@pretty:{"sortKeys":true}` |
| 2619 | results := GetManyBytes([]byte(rawJson), jsonPathExpr) |
| 2620 | assert(t, len(results) == 1) |
| 2621 | actual := results[0].Raw |
| 2622 | expected := `[[{ |
| 2623 | "a": 3, |
| 2624 | "b": 1, |
| 2625 | "c": 2 |
| 2626 | } |
| 2627 | ]]` |
| 2628 | if expected != actual { |
| 2629 | t.Fatal(strconv.Quote(rawJson) + "\n\t" + |
| 2630 | expected + "\n\t" + |
| 2631 | actual + "\n\t<<< MISMATCH >>>") |
| 2632 | } |
| 2633 | } |
| 2634 | |
| 2635 | func TestIssue301(t *testing.T) { |
| 2636 | json := `{ |
nothing calls this directly
no test coverage detected
searching dependent graphs…