{
  "schema": "https://bars.commonsware.com/conformance/schema/render-fixture.schema.json",
  "version": "0.1.0",
  "cases": [
    {
      "name": "parent-pointer-basic",
      "description": "{{ ../key }} inside a with block resolves against the parent context (one level up the stack).",
      "template": "{{#with user }}{{ ../version }}{{/with}}",
      "context": {
        "version": "1.0",
        "user": {
          "name": "Alice"
        }
      },
      "expect": {
        "kind": "output",
        "expectedOutput": "1.0"
      }
    },
    {
      "name": "parent-pointer-nested-path",
      "description": "A multi-segment RFC 6901 pointer after ../ resolves at the parent level.",
      "template": "{{#with user }}{{ ../config/theme }}{{/with}}",
      "context": {
        "config": {
          "theme": "dark"
        },
        "user": {
          "name": "Alice"
        }
      },
      "expect": {
        "kind": "output",
        "expectedOutput": "dark"
      }
    },
    {
      "name": "parent-pointer-two-levels-up",
      "description": "../../key ascends two stack levels, reaching the root context from inside two nested with blocks.",
      "template": "{{#with a }}{{#with b }}{{ ../../version }}{{/with}}{{/with}}",
      "context": {
        "version": "2.0",
        "a": {
          "b": {
            "x": 1
          }
        }
      },
      "expect": {
        "kind": "output",
        "expectedOutput": "2.0"
      }
    },
    {
      "name": "parent-pointer-three-levels-up",
      "description": "../../../key ascends three stack levels, reaching the root from inside three nested with blocks.",
      "template": "{{#with a }}{{#with b }}{{#with c }}{{ ../../../version }}{{/with}}{{/with}}{{/with}}",
      "context": {
        "version": "3.0",
        "a": {
          "b": {
            "c": {}
          }
        }
      },
      "expect": {
        "kind": "output",
        "expectedOutput": "3.0"
      }
    },
    {
      "name": "parent-pointer-intermediate-ancestor",
      "description": "../key from inside a doubly-nested with block resolves against the intermediate ancestor, not the root.",
      "template": "{{#with a }}{{#with b }}{{ ../name }}{{/with}}{{/with}}",
      "context": {
        "a": {
          "name": "level-a",
          "b": {
            "name": "level-b"
          }
        }
      },
      "expect": {
        "kind": "output",
        "expectedOutput": "level-a"
      }
    },
    {
      "name": "parent-pointer-missing-key-returns-null",
      "description": "A parent pointer to a non-existent key returns null, which renders as the literal 'null'.",
      "template": "{{#with user }}{{ ../missing }}{{/with}}",
      "context": {
        "user": {
          "name": "Alice"
        }
      },
      "expect": {
        "kind": "output",
        "expectedOutput": "null"
      }
    },
    {
      "name": "parent-pointer-at-root-errors",
      "description": "Using ../ at the root level (no enclosing with block) throws a runtime error because there is no parent context.",
      "template": "{{ ../name }}",
      "context": {
        "name": "Alice"
      },
      "expect": {
        "kind": "error"
      }
    },
    {
      "name": "parent-pointer-exceeds-stack-depth-errors",
      "description": "Using ../../ inside a single-level with block exceeds the available stack depth and throws a runtime error.",
      "template": "{{#with user }}{{ ../../name }}{{/with}}",
      "context": {
        "name": "root",
        "user": {
          "name": "user"
        }
      },
      "expect": {
        "kind": "error"
      }
    }
  ]
}
