{
  "schema": "https://bars.commonsware.com/conformance/schema/render-fixture.schema.json",
  "version": "0.1.0",
  "cases": [
    {
      "name": "replace_first-basic",
      "spotlight": true,
      "description": "Replaces only the first occurrence; later matches are untouched.",
      "template": "{{ phrase | replace_first: \"world\" \"Mark\" }}",
      "context": {
        "phrase": "hello world, big world"
      },
      "expect": {
        "kind": "output",
        "expectedOutput": "hello Mark, big world"
      }
    },
    {
      "name": "replace_first-target-absent",
      "description": "If target is not present, output equals input.",
      "template": "{{ phrase | replace_first: \"xyz\" \"abc\" }}",
      "context": {
        "phrase": "hello world"
      },
      "expect": {
        "kind": "output",
        "expectedOutput": "hello world"
      }
    },
    {
      "name": "replace_first-empty-target",
      "description": "Empty target inserts the replacement at index 0.",
      "template": "{{ phrase | replace_first: \"\" \"X\" }}",
      "context": {
        "phrase": "abc"
      },
      "expect": {
        "kind": "output",
        "expectedOutput": "Xabc"
      }
    },
    {
      "name": "replace_first-zero-args-is-error",
      "description": "Zero arguments is an arity error.",
      "template": "{{ phrase | replace_first }}",
      "context": {
        "phrase": "hello"
      },
      "expect": {
        "kind": "error",
        "errorCode": "KB-2002"
      }
    },
    {
      "name": "replace_first-one-arg-is-error",
      "description": "One argument is an arity error.",
      "template": "{{ phrase | replace_first: \"a\" }}",
      "context": {
        "phrase": "hello"
      },
      "expect": {
        "kind": "error",
        "errorCode": "KB-2002"
      }
    },
    {
      "name": "replace_first-three-args-is-error",
      "description": "Three arguments is an arity error.",
      "template": "{{ phrase | replace_first: \"a\" \"b\" \"c\" }}",
      "context": {
        "phrase": "hello"
      },
      "expect": {
        "kind": "error",
        "errorCode": "KB-2002"
      }
    },
    {
      "name": "replace_first-chained-after-upcase",
      "spotlight": true,
      "description": "Composes correctly when input arrives from a prior transform.",
      "template": "{{ phrase | upcase | replace_first: \"WORLD\" \"Mark\" }}",
      "context": {
        "phrase": "world world"
      },
      "expect": {
        "kind": "output",
        "expectedOutput": "Mark WORLD"
      }
    }
  ]
}
