{
  "schema": "https://bars.commonsware.com/conformance/schema/render-fixture.schema.json",
  "version": "0.1.0",
  "cases": [
    {
      "name": "escape_once-all-metacharacters",
      "spotlight": true,
      "description": "With no existing entities, encodes &, <, >, double-quote, and single-quote like escape. Uses {{{ }}} so the renderer does not re-escape the transform's output.",
      "template": "{{{ html | escape_once }}}",
      "context": {
        "html": "<b>A & 'B' \"C\"</b>"
      },
      "expect": {
        "kind": "output",
        "expectedOutput": "&lt;b&gt;A &amp; &#x27;B&#x27; &quot;C&quot;&lt;/b&gt;"
      }
    },
    {
      "name": "escape_once-preserves-existing-entities",
      "spotlight": true,
      "description": "An ampersand already beginning a named or numeric entity is left untouched, while bare metacharacters are encoded.",
      "template": "{{{ html | escape_once }}}",
      "context": {
        "html": "&amp; < &#x27;"
      },
      "expect": {
        "kind": "output",
        "expectedOutput": "&amp; &lt; &#x27;"
      }
    },
    {
      "name": "escape_once-bare-ampersand",
      "description": "An ampersand not followed by a valid entity is encoded.",
      "template": "{{{ html | escape_once }}}",
      "context": {
        "html": "Tom & Jerry"
      },
      "expect": {
        "kind": "output",
        "expectedOutput": "Tom &amp; Jerry"
      }
    },
    {
      "name": "escape_once-idempotent-hex-entity",
      "description": "Applying escape_once to a string already containing its own &#x27; output does not re-escape the entity's ampersand.",
      "template": "{{{ html | escape_once | escape_once }}}",
      "context": {
        "html": "it's"
      },
      "expect": {
        "kind": "output",
        "expectedOutput": "it&#x27;s"
      }
    },
    {
      "name": "escape_once-with-arg-is-error",
      "description": "Any argument is an arity error.",
      "template": "{{{ html | escape_once: \"x\" }}}",
      "context": {
        "html": "hi"
      },
      "expect": {
        "kind": "error",
        "errorCode": "KB-2002"
      }
    }
  ]
}
