{
  "schema": "https://bars.commonsware.com/conformance/schema/render-fixture.schema.json",
  "version": "0.1.0",
  "cases": [
    {
      "name": "slice-one-arg-mid-string",
      "spotlight": true,
      "description": "Single offset returns 1 character at that position.",
      "template": "{{ phrase | slice: 1 }}",
      "context": {
        "phrase": "hello"
      },
      "expect": {
        "kind": "output",
        "expectedOutput": "e"
      }
    },
    {
      "name": "slice-two-args",
      "spotlight": true,
      "description": "Offset + length returns a substring of the requested length.",
      "template": "{{ phrase | slice: 1 3 }}",
      "context": {
        "phrase": "hello"
      },
      "expect": {
        "kind": "output",
        "expectedOutput": "ell"
      }
    },
    {
      "name": "slice-negative-offset",
      "description": "Negative offset counts from the end.",
      "template": "{{ phrase | slice: -3 2 }}",
      "context": {
        "phrase": "hello"
      },
      "expect": {
        "kind": "output",
        "expectedOutput": "ll"
      }
    },
    {
      "name": "slice-length-exceeds-remaining",
      "description": "Length is clamped to the remaining string.",
      "template": "{{ phrase | slice: 2 100 }}",
      "context": {
        "phrase": "hello"
      },
      "expect": {
        "kind": "output",
        "expectedOutput": "llo"
      }
    },
    {
      "name": "slice-offset-fully-out-of-bounds",
      "description": "Positive offset past end yields empty string.",
      "template": "{{ phrase | slice: 100 5 }}",
      "context": {
        "phrase": "hello"
      },
      "expect": {
        "kind": "output",
        "expectedOutput": ""
      }
    },
    {
      "name": "slice-negative-offset-out-of-bounds",
      "description": "Negative offset past start yields empty string.",
      "template": "{{ phrase | slice: -100 5 }}",
      "context": {
        "phrase": "hello"
      },
      "expect": {
        "kind": "output",
        "expectedOutput": ""
      }
    },
    {
      "name": "slice-zero-args-is-error",
      "description": "Zero arguments is an arity error.",
      "template": "{{ phrase | slice }}",
      "context": {
        "phrase": "hi"
      },
      "expect": {
        "kind": "error",
        "errorCode": "KB-2002"
      }
    },
    {
      "name": "slice-three-args-is-error",
      "description": "Three arguments is an arity error.",
      "template": "{{ phrase | slice: 0 1 2 }}",
      "context": {
        "phrase": "hi"
      },
      "expect": {
        "kind": "error",
        "errorCode": "KB-2002"
      }
    },
    {
      "name": "slice-non-integer-offset-is-null",
      "description": "Non-integer offset is a soft failure, so slice yields null.",
      "template": "{{ phrase | slice: \"oops\" }}",
      "context": {
        "phrase": "hi"
      },
      "expect": {
        "kind": "output",
        "expectedOutput": "null"
      }
    },
    {
      "name": "slice-negative-length-is-null",
      "description": "Negative length is a soft failure, so slice yields null.",
      "template": "{{ phrase | slice: 0 -1 }}",
      "context": {
        "phrase": "hi"
      },
      "expect": {
        "kind": "output",
        "expectedOutput": "null"
      }
    },
    {
      "name": "slice-non-integer-length-is-null",
      "description": "Non-integer length is a soft failure, so slice yields null.",
      "template": "{{ phrase | slice: 0 \"oops\" }}",
      "context": {
        "phrase": "hi"
      },
      "expect": {
        "kind": "output",
        "expectedOutput": "null"
      }
    },
    {
      "name": "slice-astral-does-not-split-surrogate",
      "description": "Offsets count code points, so a surrogate pair is sliced out whole rather than split into a lone half.",
      "template": "{{ s | slice: 1 1 }}",
      "context": {
        "s": "a😀b"
      },
      "expect": {
        "kind": "output",
        "expectedOutput": "😀"
      }
    }
  ]
}
