{
  "schema": "https://bars.commonsware.com/conformance/schema/partials-fixture.schema.json",
  "version": "0.1.0",
  "cases": [
    {
      "name": "duplicate-inline-definition-last-wins-and-reports",
      "description": "Two {{#inline g }} blocks defining the same name in the same enclosing block resolve to the later ('last-wins') definition, and the fold reports one DuplicateDefinition soft-fail event for the overridden name. The event is stamped at the root, so its partialStack is empty.",
      "template": "{{#inline g }}FIRST{{/inline}}{{#inline g }}SECOND{{/inline}}{{> g }}",
      "partials": {},
      "expect": {
        "kind": "output",
        "expectedOutput": "SECOND",
        "softFails": [
          {
            "category": "DuplicateDefinition",
            "partialStack": [],
            "errorCode": "KB-5008"
          }
        ]
      }
    },
    {
      "name": "duplicate-inline-definition-inside-a-loaded-partial-reports-its-partial-stack",
      "description": "A duplicate name declared inside a loaded partial's own body is folded (and reported) while that partial's body is being rendered, so the event's partialStack names the enclosing partial.",
      "template": "{{> outer }}",
      "partials": {
        "outer": "{{#inline g }}A{{/inline}}{{#inline g }}B{{/inline}}{{> g }}"
      },
      "expect": {
        "kind": "output",
        "expectedOutput": "B",
        "softFails": [
          {
            "category": "DuplicateDefinition",
            "partialStack": ["outer"],
            "errorCode": "KB-5008"
          }
        ]
      }
    },
    {
      "name": "duplicate-inline-definition-inside-each-reports-once-per-iteration",
      "description": "The pre-scan/fold that detects a duplicate name runs once per render occurrence of the enclosing block, so a duplicate inside a {{#each}} body reports one DuplicateDefinition event per loop iteration, not once overall.",
      "template": "{{#each items }}{{#inline g }}A{{/inline}}{{#inline g }}B{{/inline}}{{> g }}{{/each}}",
      "context": {
        "items": [1, 2]
      },
      "partials": {},
      "expect": {
        "kind": "output",
        "expectedOutput": "BB",
        "softFails": [
          {
            "category": "DuplicateDefinition",
            "partialStack": [],
            "errorCode": "KB-5008"
          },
          {
            "category": "DuplicateDefinition",
            "partialStack": [],
            "errorCode": "KB-5008"
          }
        ]
      }
    }
  ]
}
