{
  "schema": "https://bars.commonsware.com/conformance/schema/partials-fixture.schema.json",
  "version": "0.1.0",
  "cases": [
    {
      "name": "soft-failure-in-root-has-empty-partial-stack",
      "description": "A soft failure in the root template is stamped with a Root-only stack, so its encoded partialStack is empty. abs on a non-numeric input soft-fails as TypeMismatch and renders 'null'.",
      "template": "{{ x | abs }}",
      "context": {
        "x": "not-a-number"
      },
      "expect": {
        "kind": "output",
        "expectedOutput": "null",
        "softFails": [
          {
            "category": "TypeMismatch",
            "partialStack": []
          }
        ]
      }
    },
    {
      "name": "soft-failure-inside-partial-carries-partial-key",
      "description": "A soft failure raised while rendering a partial is stamped with that partial's key, so its partialStack is ['mathPartial'].",
      "template": "{{> mathPartial }}",
      "context": {
        "x": "not-a-number"
      },
      "partials": {
        "mathPartial": "{{ x | abs }}"
      },
      "expect": {
        "kind": "output",
        "expectedOutput": "null",
        "softFails": [
          {
            "category": "TypeMismatch",
            "partialStack": [
              "mathPartial"
            ]
          }
        ]
      }
    },
    {
      "name": "soft-failure-in-partial-reports-partial-own-location",
      "description": "A soft failure on the second line of a partial's body reports that partial's own line/column, not the caller's — the failing expression is line 2 of 'inner', not line 1 of the root template that invokes it.",
      "template": "{{> inner }}",
      "context": {
        "x": "not-a-number"
      },
      "partials": {
        "inner": "ok\n{{ x | abs }}"
      },
      "expect": {
        "kind": "output",
        "expectedOutput": "ok\nnull",
        "softFails": [
          {
            "category": "TypeMismatch",
            "partialStack": [
              "inner"
            ],
            "errorCode": "KB-5001",
            "line": 2,
            "column": 3
          }
        ]
      }
    },
    {
      "name": "soft-failure-in-doubly-nested-partial-carries-full-stack",
      "description": "A soft failure in a partial reached through another partial carries the full chain of partial keys, outermost-first.",
      "template": "{{> outer }}",
      "context": {
        "x": "not-a-number"
      },
      "partials": {
        "outer": "{{> inner }}",
        "inner": "{{ x | abs }}"
      },
      "expect": {
        "kind": "output",
        "expectedOutput": "null",
        "softFails": [
          {
            "category": "TypeMismatch",
            "partialStack": [
              "outer",
              "inner"
            ]
          }
        ]
      }
    }
  ]
}
