{
  "schema": "https://bars.commonsware.com/conformance/schema/render-fixture.schema.json",
  "version": "0.1.0",
  "cases": [
    {
      "name": "size-list",
      "spotlight": true,
      "description": "Returns the number of elements in a list.",
      "template": "{{ xs | size }}",
      "context": {
        "xs": [
          1,
          2,
          3,
          4
        ]
      },
      "expect": {
        "kind": "output",
        "expectedOutput": "4"
      }
    },
    {
      "name": "size-empty-list",
      "description": "The size of an empty list is zero.",
      "template": "{{ xs | size }}",
      "context": {
        "xs": []
      },
      "expect": {
        "kind": "output",
        "expectedOutput": "0"
      }
    },
    {
      "name": "size-string",
      "spotlight": true,
      "description": "Liquid-compatible: the character count of a string.",
      "template": "{{ s | size }}",
      "context": {
        "s": "hello"
      },
      "expect": {
        "kind": "output",
        "expectedOutput": "5"
      }
    },
    {
      "name": "size-struct-is-null",
      "description": "A struct input is neither list nor string, so the result is null.",
      "template": "{{ o | size }}",
      "context": {
        "o": {
          "a": 1
        }
      },
      "expect": {
        "kind": "output",
        "expectedOutput": "null"
      }
    },
    {
      "name": "size-number-is-null",
      "description": "A non-string primitive (number) is neither list nor string, so the result is null.",
      "template": "{{ n | size }}",
      "context": {
        "n": 5
      },
      "expect": {
        "kind": "output",
        "expectedOutput": "null"
      }
    },
    {
      "name": "size-with-arg-is-error",
      "description": "Any argument is an arity error.",
      "template": "{{ xs | size: \"x\" }}",
      "context": {
        "xs": [
          1
        ]
      },
      "expect": {
        "kind": "error",
        "errorCode": "KB-2002"
      }
    },
    {
      "name": "size-astral-string-counts-code-points",
      "description": "A surrogate-pair (astral) character counts as one code point, not two UTF-16 units.",
      "template": "{{ s | size }}",
      "context": {
        "s": "a😀b"
      },
      "expect": {
        "kind": "output",
        "expectedOutput": "3"
      }
    },
    {
      "name": "size-lone-surrogate-counts-as-one",
      "description": "An unpaired (lone) surrogate counts as a single code-point-sized unit, not zero and not an error.",
      "template": "{{ s | size }}",
      "context": {
        "s": "a\ud800b"
      },
      "expect": {
        "kind": "output",
        "expectedOutput": "3"
      }
    }
  ]
}
