{
  "schema": "https://bars.commonsware.com/conformance/schema/render-fixture.schema.json",
  "version": "0.1.0",
  "cases": [
    {
      "name": "replace-two-string-literals",
      "spotlight": true,
      "description": "Replace all occurrences of a substring via {{ phrase | replace: \"world\" \"Mark\" }}.",
      "template": "{{ phrase | replace: \"world\" \"Mark\" }}",
      "context": {
        "phrase": "hello world, big world"
      },
      "expect": {
        "kind": "output",
        "expectedOutput": "hello Mark, big Mark"
      }
    },
    {
      "name": "replace-target-absent",
      "description": "Replace when target substring is not present acts as a no-op.",
      "template": "{{ phrase | replace: \"xyz\" \"abc\" }}",
      "context": {
        "phrase": "hello world"
      },
      "expect": {
        "kind": "output",
        "expectedOutput": "hello world"
      }
    },
    {
      "name": "replace-empty-string-target",
      "description": "Replacing empty string inserts replacement before each character and at the end. \"ab\".replace(\"\", \"x\") = \"xaxbx\".",
      "template": "{{ phrase | replace: \"\" \"x\" }}",
      "context": {
        "phrase": "ab"
      },
      "expect": {
        "kind": "output",
        "expectedOutput": "xaxbx"
      }
    },
    {
      "name": "replace-zero-args-is-error",
      "description": "Calling replace with zero arguments produces an arity error.",
      "template": "{{ phrase | replace }}",
      "context": {
        "phrase": "hello"
      },
      "expect": {
        "kind": "error",
        "errorCode": "KB-2002"
      }
    },
    {
      "name": "replace-one-arg-is-error",
      "description": "Calling replace with one argument produces an arity error.",
      "template": "{{ phrase | replace: \"old\" }}",
      "context": {
        "phrase": "hello"
      },
      "expect": {
        "kind": "error",
        "errorCode": "KB-2002"
      }
    },
    {
      "name": "replace-three-args-is-error",
      "description": "Calling replace with three arguments produces an arity error.",
      "template": "{{ phrase | replace: \"a\" \"b\" \"c\" }}",
      "context": {
        "phrase": "hello"
      },
      "expect": {
        "kind": "error",
        "errorCode": "KB-2002"
      }
    },
    {
      "name": "replace-chained-after-upcase",
      "spotlight": true,
      "description": "Chaining replace after upcase: {{ phrase | upcase | replace: \"WORLD\" \"Mark\" }}.",
      "template": "{{ phrase | upcase | replace: \"WORLD\" \"Mark\" }}",
      "context": {
        "phrase": "hello world"
      },
      "expect": {
        "kind": "output",
        "expectedOutput": "HELLO Mark"
      }
    }
  ]
}
