{
  "schema": "https://bars.commonsware.com/conformance/schema/render-fixture.schema.json",
  "version": "0.1.0",
  "cases": [
    {
      "name": "contains-string-substring-match",
      "spotlight": true,
      "description": "String input contains the substring argument.",
      "template": "{{ phrase | contains: \"world\" }}",
      "context": {
        "phrase": "hello world"
      },
      "expect": {
        "kind": "output",
        "expectedOutput": "true"
      }
    },
    {
      "name": "contains-string-substring-miss",
      "description": "String input does not contain the substring argument.",
      "template": "{{ phrase | contains: \"xyz\" }}",
      "context": {
        "phrase": "hello world"
      },
      "expect": {
        "kind": "output",
        "expectedOutput": "false"
      }
    },
    {
      "name": "contains-array-element-string-match",
      "spotlight": true,
      "description": "Array input contains the string argument as an element.",
      "template": "{{ items | contains: \"b\" }}",
      "context": {
        "items": [
          "a",
          "b",
          "c"
        ]
      },
      "expect": {
        "kind": "output",
        "expectedOutput": "true"
      }
    },
    {
      "name": "contains-array-element-asString-match",
      "description": "Array element 2 (numeric) asString-equals argument \"2\" so match is true.",
      "template": "{{ items | contains: \"2\" }}",
      "context": {
        "items": [
          1,
          2,
          3
        ]
      },
      "expect": {
        "kind": "output",
        "expectedOutput": "true"
      }
    },
    {
      "name": "contains-array-element-miss",
      "description": "Array input does not contain the argument.",
      "template": "{{ items | contains: \"z\" }}",
      "context": {
        "items": [
          "a",
          "b",
          "c"
        ]
      },
      "expect": {
        "kind": "output",
        "expectedOutput": "false"
      }
    },
    {
      "name": "contains-empty-array-is-false",
      "description": "An empty array never contains anything.",
      "template": "{{ items | contains: \"anything\" }}",
      "context": {
        "items": []
      },
      "expect": {
        "kind": "output",
        "expectedOutput": "false"
      }
    },
    {
      "name": "contains-null-input-coerced",
      "description": "Null input coerces to the literal string \"null\", which contains \"ull\".",
      "template": "{{ missing | contains: \"ull\" }}",
      "context": {},
      "expect": {
        "kind": "output",
        "expectedOutput": "true"
      }
    },
    {
      "name": "contains-numeric-input-coerced",
      "description": "Numeric input coerces to its rendered string form, then substring check.",
      "template": "{{ value | contains: \"23\" }}",
      "context": {
        "value": 12345
      },
      "expect": {
        "kind": "output",
        "expectedOutput": "true"
      }
    },
    {
      "name": "contains-object-input-coerced",
      "description": "Object input coerces to its compact JSON form, then substring check matches.",
      "template": "{{ user | contains: \"alice\" }}",
      "context": {
        "user": {
          "name": "alice"
        }
      },
      "expect": {
        "kind": "output",
        "expectedOutput": "true"
      }
    },
    {
      "name": "contains-zero-args-is-error",
      "description": "Calling contains with zero arguments produces an arity error.",
      "template": "{{ phrase | contains }}",
      "context": {
        "phrase": "hi"
      },
      "expect": {
        "kind": "error",
        "errorCode": "KB-2002"
      }
    },
    {
      "name": "contains-two-args-is-error",
      "description": "Calling contains with two arguments produces an arity error.",
      "template": "{{ phrase | contains: \"a\" \"b\" }}",
      "context": {
        "phrase": "hi"
      },
      "expect": {
        "kind": "error",
        "errorCode": "KB-2002"
      }
    },
    {
      "name": "contains-chained-after-upcase",
      "description": "Chaining contains after upcase: \"HELLO\" contains \"ELL\".",
      "template": "{{ phrase | upcase | contains: \"ELL\" }}",
      "context": {
        "phrase": "hello"
      },
      "expect": {
        "kind": "output",
        "expectedOutput": "true"
      }
    },
    {
      "name": "contains-chained-before-upcase",
      "description": "Chaining contains before upcase: \"true\" upcases to \"TRUE\".",
      "template": "{{ phrase | contains: \"ell\" | upcase }}",
      "context": {
        "phrase": "hello"
      },
      "expect": {
        "kind": "output",
        "expectedOutput": "TRUE"
      }
    }
  ]
}
