{
  "schema": "https://bars.commonsware.com/conformance/schema/render-fixture.schema.json",
  "version": "0.1.0",
  "cases": [
    {
      "name": "find_index-property-value",
      "spotlight": true,
      "description": "With two arguments, returns the index of the first struct whose property equals the value.",
      "template": "{{ items | find_index: \"k\" \"b\" }}",
      "context": {
        "items": [
          {
            "k": "a"
          },
          {
            "k": "b"
          }
        ]
      },
      "expect": {
        "kind": "output",
        "expectedOutput": "1"
      }
    },
    {
      "name": "find_index-property-truthy",
      "spotlight": true,
      "description": "With one argument, returns the index of the first struct whose property is truthy.",
      "template": "{{ items | find_index: \"ok\" }}",
      "context": {
        "items": [
          {
            "ok": false
          },
          {
            "ok": true
          }
        ]
      },
      "expect": {
        "kind": "output",
        "expectedOutput": "1"
      }
    },
    {
      "name": "find_index-no-match-is-null",
      "description": "When nothing matches, the result is null.",
      "template": "{{ items | find_index: \"k\" \"z\" }}",
      "context": {
        "items": [
          {
            "k": "a"
          }
        ]
      },
      "expect": {
        "kind": "output",
        "expectedOutput": "null"
      }
    },
    {
      "name": "find_index-non-list-is-null",
      "description": "find_index operates only on lists; a string input yields null.",
      "template": "{{ x | find_index: \"k\" }}",
      "context": {
        "x": "hi"
      },
      "expect": {
        "kind": "output",
        "expectedOutput": "null"
      }
    },
    {
      "name": "find_index-non-struct-contents-is-null",
      "description": "find_index expects a list of structs; non-struct contents yield null.",
      "template": "{{ xs | find_index: \"k\" }}",
      "context": {
        "xs": [
          1
        ]
      },
      "expect": {
        "kind": "output",
        "expectedOutput": "null"
      }
    },
    {
      "name": "find_index-zero-args-is-error",
      "description": "Zero arguments is an arity error.",
      "template": "{{ items | find_index }}",
      "context": {
        "items": [
          {
            "k": "a"
          }
        ]
      },
      "expect": {
        "kind": "error",
        "errorCode": "KB-2002"
      }
    },
    {
      "name": "find_index-three-args-is-error",
      "description": "More than two arguments is an arity error.",
      "template": "{{ items | find_index: \"k\" \"a\" \"b\" }}",
      "context": {
        "items": [
          {
            "k": "a"
          }
        ]
      },
      "expect": {
        "kind": "error",
        "errorCode": "KB-2002"
      }
    }
  ]
}
