{
  "schema": "https://bars.commonsware.com/conformance/schema/render-fixture.schema.json",
  "version": "0.1.0",
  "cases": [
    {
      "name": "trim-open-strips-leading-template-text",
      "description": "{{~ /s }} strips whitespace from the preceding template text (trimOpen). The interpolated value itself is untouched.",
      "template": "before  {{~ /s }}after",
      "context": {
        "s": "X"
      },
      "expect": {
        "kind": "output",
        "expectedOutput": "beforeXafter"
      }
    },
    {
      "name": "trim-close-strips-trailing-template-text",
      "description": "{{ /s ~}} strips whitespace from the following template text (trimClose). The interpolated value itself is untouched.",
      "template": "before{{ /s ~}}  after",
      "context": {
        "s": "X"
      },
      "expect": {
        "kind": "output",
        "expectedOutput": "beforeXafter"
      }
    },
    {
      "name": "trim-both-strips-surrounding-template-text",
      "description": "{{~ /s ~}} strips whitespace from the template text on both sides of the tag.",
      "template": "before  {{~ /s ~}}  after",
      "context": {
        "s": "X"
      },
      "expect": {
        "kind": "output",
        "expectedOutput": "beforeXafter"
      }
    },
    {
      "name": "trim-open-does-not-touch-value-whitespace",
      "description": "trimOpen strips template text, never the interpolated value's own whitespace.",
      "template": "before  {{~ /s }}after",
      "context": {
        "s": "   "
      },
      "expect": {
        "kind": "output",
        "expectedOutput": "before   after"
      }
    },
    {
      "name": "trim-close-no-template-whitespace-is-no-op",
      "description": "trimClose is a no-op when the following template text has no leading whitespace to strip.",
      "template": "before{{ /s ~}}after",
      "context": {
        "s": "X"
      },
      "expect": {
        "kind": "output",
        "expectedOutput": "beforeXafter"
      }
    },
    {
      "name": "unescaped-trim-open-strips-leading-template-text",
      "description": "{{{~ /s }}} strips whitespace from the preceding template text; the unescaped value is untouched.",
      "template": "before  {{{~ /s }}}after",
      "context": {
        "s": "X"
      },
      "expect": {
        "kind": "output",
        "expectedOutput": "beforeXafter"
      }
    },
    {
      "name": "unescaped-trim-close-strips-trailing-template-text",
      "description": "{{{ /s ~}}} strips whitespace from the following template text; the unescaped value is untouched.",
      "template": "before{{{ /s ~}}}  after",
      "context": {
        "s": "X"
      },
      "expect": {
        "kind": "output",
        "expectedOutput": "beforeXafter"
      }
    },
    {
      "name": "with-block-trim-reaches-into-body",
      "description": "~ on the #with opener's close side and the /with closer's open side strips whitespace from just inside the block body, leaving text outside the block untouched.",
      "template": "X{{#with y ~}}\n  Z\n{{~/with}}Y",
      "context": {
        "y": {}
      },
      "expect": {
        "kind": "output",
        "expectedOutput": "XZY"
      }
    },
    {
      "name": "with-block-trim-reaches-outside-body",
      "description": "~ on the #with opener's open side and the /with closer's close side strips whitespace from the text surrounding the whole block, leaving the body untouched.",
      "template": "X  {{~#with y }}Z{{/with~}}  Y",
      "context": {
        "y": {}
      },
      "expect": {
        "kind": "output",
        "expectedOutput": "XZY"
      }
    },
    {
      "name": "each-block-trim-reaches-into-body-every-iteration",
      "description": "~ on the #each opener's close side and the /each closer's open side strips whitespace from just inside the loop body; the strip applies on every iteration since it is resolved on the body's own AST once, before any iteration runs.",
      "template": "{{#each items ~}}\n{{ this }}\n{{~/each}}",
      "context": {
        "items": ["a", "b"]
      },
      "expect": {
        "kind": "output",
        "expectedOutput": "ab"
      }
    },
    {
      "name": "each-block-else-trim",
      "description": "~ on the {{else}} tag strips whitespace across the else-body boundary when the list is empty and the else branch renders.",
      "template": "{{#each items ~}}\nX\n{{~else~}}\nY\n{{~/each}}",
      "context": {
        "items": []
      },
      "expect": {
        "kind": "output",
        "expectedOutput": "Y"
      }
    },
    {
      "name": "if-block-else-if-arm-trim",
      "description": "~ on an {{else if}} tag's open side strips the trailing whitespace of the *previous* arm's body, even though that arm — not the else-if arm — is the one that ends up rendering.",
      "template": "{{#if a }}A\n{{~else if b }}\nB{{/if}}",
      "context": {
        "a": true
      },
      "expect": {
        "kind": "output",
        "expectedOutput": "A"
      }
    },
    {
      "name": "if-block-else-trim",
      "description": "~ on a plain {{else}} tag strips whitespace across the arm/else-body boundary when the else branch renders.",
      "template": "{{#if a }}A\n{{~else~}}\nB{{/if}}",
      "context": {
        "a": false
      },
      "expect": {
        "kind": "output",
        "expectedOutput": "B"
      }
    },
    {
      "name": "unless-block-trim-reaches-outside-body",
      "description": "~ on the #unless opener's open side and the /unless closer's close side strips whitespace surrounding the whole block, leaving the body untouched.",
      "template": "X  {{~#unless flag }}Z{{/unless~}}  Y",
      "context": {
        "flag": false
      },
      "expect": {
        "kind": "output",
        "expectedOutput": "XZY"
      }
    },
    {
      "name": "comment-trim-both",
      "description": "~ on both sides of a comment tag strips the surrounding template text; the comment itself never renders anything.",
      "template": "before  {{~! note ~}}  after",
      "expect": {
        "kind": "output",
        "expectedOutput": "beforeafter"
      }
    },
    {
      "name": "assign-trim-both",
      "description": "~ on both sides of an assign tag strips the surrounding template text; the tag itself never renders anything.",
      "template": "before  {{~= @local/t = \"Lo\" ~}}  after{{ @local/t }}",
      "expect": {
        "kind": "output",
        "expectedOutput": "beforeafterLo"
      }
    }
  ]
}
