{
  "schema": "https://bars.commonsware.com/conformance/schema/render-fixture.schema.json",
  "version": "0.1.0",
  "cases": [
    {
      "name": "compact-removes-nulls",
      "spotlight": true,
      "description": "Null elements are removed from the list; surviving elements keep their order.",
      "template": "{{ xs | compact }}",
      "context": {
        "xs": [
          1,
          null,
          2,
          null,
          3
        ]
      },
      "expect": {
        "kind": "output",
        "expectedOutput": "[1,2,3]"
      }
    },
    {
      "name": "compact-no-nulls",
      "spotlight": true,
      "description": "A list with no null elements is returned unchanged.",
      "template": "{{ xs | compact }}",
      "context": {
        "xs": [
          "a",
          "b"
        ]
      },
      "expect": {
        "kind": "output",
        "expectedOutput": "[\"a\",\"b\"]"
      }
    },
    {
      "name": "compact-non-list-is-null",
      "description": "A non-list input does not match the transform's shape, so the result is null.",
      "template": "{{ x | compact }}",
      "context": {
        "x": "hello"
      },
      "expect": {
        "kind": "output",
        "expectedOutput": "null"
      }
    },
    {
      "name": "compact-null-input-is-null",
      "description": "A null (missing) input is not a list, so the result is null.",
      "template": "{{ missing | compact }}",
      "context": {},
      "expect": {
        "kind": "output",
        "expectedOutput": "null"
      }
    },
    {
      "name": "compact-keeps-non-primitive-elements",
      "description": "Non-primitive elements (structs) are not null, so compact keeps them.",
      "template": "{{ xs | compact }}",
      "context": {
        "xs": [
          {
            "a": 1
          },
          null,
          2
        ]
      },
      "expect": {
        "kind": "output",
        "expectedOutput": "[{\"a\":1},2]"
      }
    },
    {
      "name": "compact-with-arg-is-error",
      "description": "Any argument is an arity error.",
      "template": "{{ xs | compact: \"x\" }}",
      "context": {
        "xs": [
          1
        ]
      },
      "expect": {
        "kind": "error",
        "errorCode": "KB-2002"
      }
    }
  ]
}
