---
cases:
  - data: {}
    modules:
      - |
        package generated

        p {
          __local0__ = {"a": {"b": 2, "c": 3}}
          json.remove(__local0__, {"a"}, __local1__)
          __local1__ = {}
          json.remove(__local0__, {"a/b"}, __local2__)
          __local2__ = {"a": {"c": 3}}
          json.remove(__local0__, {"a/c"}, __local3__)
          __local3__ = {"a": {"b": 2}}
          __local0__ = {"a": {"b": 2, "c": 3}}
        }
    note: jsonremoveidempotent/TestBuiltinJSONRemoveIdempotent
    query: data.generated.p = x
    want_result:
      - x: true
