{
  "schema": "https://bars.commonsware.com/conformance/schema/render-fixture.schema.json",
  "version": "0.1.0",
  "cases": [
    {
      "name": "first-list",
      "spotlight": true,
      "description": "Returns the first element of a list.",
      "template": "{{ xs | first }}",
      "context": {
        "xs": [
          10,
          20,
          30
        ]
      },
      "expect": {
        "kind": "output",
        "expectedOutput": "10"
      }
    },
    {
      "name": "first-empty-list-is-null",
      "description": "The first element of an empty list is null.",
      "template": "{{ xs | first }}",
      "context": {
        "xs": []
      },
      "expect": {
        "kind": "output",
        "expectedOutput": "null"
      }
    },
    {
      "name": "first-string",
      "spotlight": true,
      "description": "Liquid-compatible: the first character of a string.",
      "template": "{{ s | first }}",
      "context": {
        "s": "hello"
      },
      "expect": {
        "kind": "output",
        "expectedOutput": "h"
      }
    },
    {
      "name": "first-empty-string-is-null",
      "description": "The first character of an empty string is null.",
      "template": "{{ s | first }}",
      "context": {
        "s": ""
      },
      "expect": {
        "kind": "output",
        "expectedOutput": "null"
      }
    },
    {
      "name": "first-non-list-non-string-is-null",
      "description": "A numeric input is neither list nor string, so the result is null.",
      "template": "{{ n | first }}",
      "context": {
        "n": 5
      },
      "expect": {
        "kind": "output",
        "expectedOutput": "null"
      }
    },
    {
      "name": "first-struct-is-null",
      "description": "A struct input is neither list nor string, so the result is null.",
      "template": "{{ o | first }}",
      "context": {
        "o": {
          "a": 1
        }
      },
      "expect": {
        "kind": "output",
        "expectedOutput": "null"
      }
    },
    {
      "name": "first-with-arg-is-error",
      "description": "Any argument is an arity error.",
      "template": "{{ xs | first: \"x\" }}",
      "context": {
        "xs": [
          1
        ]
      },
      "expect": {
        "kind": "error",
        "errorCode": "KB-2002"
      }
    }
  ]
}
