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