{
  "schema": "https://bars.commonsware.com/conformance/schema/render-fixture.schema.json",
  "version": "0.1.0",
  "cases": [
    {
      "name": "grouping-or-first-diverges-from-and-first",
      "description": "With a=false, b=true, c=true: 'a and (b or c)' groups the or first ('b or c' = true), giving 'false and true' = false.",
      "template": "{{ a and (b or c) }}",
      "context": {
        "a": false,
        "b": true,
        "c": true
      },
      "expect": {
        "kind": "output",
        "expectedOutput": "false"
      }
    },
    {
      "name": "grouping-and-first-diverges-from-or-first",
      "description": "Same context (a=false, b=true, c=true), but grouping the and first instead: '(a and b) or c' gives '(false and true) or true' = 'false or true' = true — the opposite of grouping-or-first-diverges-from-and-first, proving the parenthesization (not the operator order) decides which sub-expression is evaluated together.",
      "template": "{{ (a and b) or c }}",
      "context": {
        "a": false,
        "b": true,
        "c": true
      },
      "expect": {
        "kind": "output",
        "expectedOutput": "true"
      }
    },
    {
      "name": "both-sides-grouped-in-if-block",
      "description": "Parenthesized chains on both sides of an outer 'and', inside an #if block: '(a or b) and (c or d)' with a=false, b=true, c=false, d=false evaluates '(false or true) and (false or false)' = 'true and false' = false, so the else branch renders.",
      "template": "{{#if (a or b) and (c or d) }}yes{{else}}no{{/if}}",
      "context": {
        "a": false,
        "b": true,
        "c": false,
        "d": false
      },
      "expect": {
        "kind": "output",
        "expectedOutput": "no"
      }
    },
    {
      "name": "nested-grouping-flips-result",
      "description": "Nested grouping 'a and (b or (c and d))' with a=true, b=false, c=true, d=false evaluates the innermost 'c and d' = false first, then 'b or false' = false, then 'true and false' = false.",
      "template": "{{ a and (b or (c and d)) }}",
      "context": {
        "a": true,
        "b": false,
        "c": true,
        "d": false
      },
      "expect": {
        "kind": "output",
        "expectedOutput": "false"
      }
    },
    {
      "name": "nested-grouping-with-true-d",
      "description": "Same nested template with d flipped to true: innermost 'c and d' = true, then 'b or true' = true, then 'true and true' = true — showing the nested group's value drives the outer result.",
      "template": "{{ a and (b or (c and d)) }}",
      "context": {
        "a": true,
        "b": false,
        "c": true,
        "d": true
      },
      "expect": {
        "kind": "output",
        "expectedOutput": "true"
      }
    },
    {
      "name": "transform-inside-parenthesized-operand",
      "description": "A transform applied inside a parenthesized operand runs before the outer comparison: '(items | size) > 0' resolves the group's chain (identifier 'items' piped through 'size') to a number, then compares it against the literal 0.",
      "template": "{{#if (items | size) > 0 }}nonempty{{else}}empty{{/if}}",
      "context": {
        "items": [1, 2, 3]
      },
      "expect": {
        "kind": "output",
        "expectedOutput": "nonempty"
      }
    },
    {
      "name": "transform-inside-parenthesized-operand-empty",
      "description": "Same template as transform-inside-parenthesized-operand, but with an empty array: '(items | size) > 0' resolves to '0 > 0' = false, so the else branch renders.",
      "template": "{{#if (items | size) > 0 }}nonempty{{else}}empty{{/if}}",
      "context": {
        "items": []
      },
      "expect": {
        "kind": "output",
        "expectedOutput": "empty"
      }
    },
    {
      "name": "standalone-grouped-expression-interpolated",
      "description": "A standalone parenthesized expression chain as the entire interpolated expression: '{{ (a or b) }}' renders the boolean result of the grouped 'or' directly.",
      "template": "{{ (a or b) }}",
      "context": {
        "a": false,
        "b": true
      },
      "expect": {
        "kind": "output",
        "expectedOutput": "true"
      }
    }
  ]
}
