{
  "tests": [
    {
      "name": "space between function name and parenthesis",
      "selector": "$[?count (@.*)==1]",
      "invalid_selector": true,
      "tags": [
        "whitespace",
        "function",
        "count"
      ]
    },
    {
      "name": "newline between function name and parenthesis",
      "selector": "$[?count\n(@.*)==1]",
      "invalid_selector": true,
      "tags": [
        "whitespace",
        "function",
        "count"
      ]
    },
    {
      "name": "tab between function name and parenthesis",
      "selector": "$[?count\t(@.*)==1]",
      "invalid_selector": true,
      "tags": [
        "whitespace",
        "function",
        "count"
      ]
    },
    {
      "name": "return between function name and parenthesis",
      "selector": "$[?count\r(@.*)==1]",
      "invalid_selector": true,
      "tags": [
        "whitespace",
        "function",
        "count"
      ]
    },
    {
      "name": "space between parenthesis and arg",
      "selector": "$[?count( @.*)==1]",
      "document": [
        {
          "a": 1
        },
        {
          "b": 2
        },
        {
          "a": 2,
          "b": 1
        }
      ],
      "result": [
        {
          "a": 1
        },
        {
          "b": 2
        }
      ],
      "result_paths": [
        "$[0]",
        "$[1]"
      ],
      "tags": [
        "whitespace",
        "function",
        "count"
      ]
    },
    {
      "name": "newline between parenthesis and arg",
      "selector": "$[?count(\n@.*)==1]",
      "document": [
        {
          "a": 1
        },
        {
          "b": 2
        },
        {
          "a": 2,
          "b": 1
        }
      ],
      "result": [
        {
          "a": 1
        },
        {
          "b": 2
        }
      ],
      "result_paths": [
        "$[0]",
        "$[1]"
      ],
      "tags": [
        "whitespace",
        "function",
        "count"
      ]
    },
    {
      "name": "tab between parenthesis and arg",
      "selector": "$[?count(\t@.*)==1]",
      "document": [
        {
          "a": 1
        },
        {
          "b": 2
        },
        {
          "a": 2,
          "b": 1
        }
      ],
      "result": [
        {
          "a": 1
        },
        {
          "b": 2
        }
      ],
      "result_paths": [
        "$[0]",
        "$[1]"
      ],
      "tags": [
        "whitespace",
        "function",
        "count"
      ]
    },
    {
      "name": "return between parenthesis and arg",
      "selector": "$[?count(\r@.*)==1]",
      "document": [
        {
          "a": 1
        },
        {
          "b": 2
        },
        {
          "a": 2,
          "b": 1
        }
      ],
      "result": [
        {
          "a": 1
        },
        {
          "b": 2
        }
      ],
      "result_paths": [
        "$[0]",
        "$[1]"
      ],
      "tags": [
        "whitespace",
        "function",
        "count"
      ]
    },
    {
      "name": "space between arg and comma",
      "selector": "$[?search(@ ,'[a-z]+')]",
      "document": [
        "foo",
        "123"
      ],
      "result": [
        "foo"
      ],
      "result_paths": [
        "$[0]"
      ],
      "tags": [
        "whitespace",
        "function",
        "search"
      ]
    },
    {
      "name": "newline between arg and comma",
      "selector": "$[?search(@\n,'[a-z]+')]",
      "document": [
        "foo",
        "123"
      ],
      "result": [
        "foo"
      ],
      "result_paths": [
        "$[0]"
      ],
      "tags": [
        "whitespace",
        "function",
        "search"
      ]
    },
    {
      "name": "tab between arg and comma",
      "selector": "$[?search(@\t,'[a-z]+')]",
      "document": [
        "foo",
        "123"
      ],
      "result": [
        "foo"
      ],
      "result_paths": [
        "$[0]"
      ],
      "tags": [
        "whitespace",
        "function",
        "search"
      ]
    },
    {
      "name": "return between arg and comma",
      "selector": "$[?search(@\r,'[a-z]+')]",
      "document": [
        "foo",
        "123"
      ],
      "result": [
        "foo"
      ],
      "result_paths": [
        "$[0]"
      ],
      "tags": [
        "whitespace",
        "function",
        "search"
      ]
    },
    {
      "name": "space between comma and arg",
      "selector": "$[?search(@, '[a-z]+')]",
      "document": [
        "foo",
        "123"
      ],
      "result": [
        "foo"
      ],
      "result_paths": [
        "$[0]"
      ],
      "tags": [
        "whitespace",
        "function",
        "search"
      ]
    },
    {
      "name": "newline between comma and arg",
      "selector": "$[?search(@,\n'[a-z]+')]",
      "document": [
        "foo",
        "123"
      ],
      "result": [
        "foo"
      ],
      "result_paths": [
        "$[0]"
      ],
      "tags": [
        "whitespace",
        "function",
        "search"
      ]
    },
    {
      "name": "tab between comma and arg",
      "selector": "$[?search(@,\t'[a-z]+')]",
      "document": [
        "foo",
        "123"
      ],
      "result": [
        "foo"
      ],
      "result_paths": [
        "$[0]"
      ],
      "tags": [
        "whitespace",
        "function",
        "search"
      ]
    },
    {
      "name": "return between comma and arg",
      "selector": "$[?search(@,\r'[a-z]+')]",
      "document": [
        "foo",
        "123"
      ],
      "result": [
        "foo"
      ],
      "result_paths": [
        "$[0]"
      ],
      "tags": [
        "whitespace",
        "function",
        "search"
      ]
    },
    {
      "name": "space between arg and parenthesis",
      "selector": "$[?count(@.* )==1]",
      "document": [
        {
          "a": 1
        },
        {
          "b": 2
        },
        {
          "a": 2,
          "b": 1
        }
      ],
      "result": [
        {
          "a": 1
        },
        {
          "b": 2
        }
      ],
      "result_paths": [
        "$[0]",
        "$[1]"
      ],
      "tags": [
        "whitespace",
        "function",
        "search"
      ]
    },
    {
      "name": "newline between arg and parenthesis",
      "selector": "$[?count(@.*\n)==1]",
      "document": [
        {
          "a": 1
        },
        {
          "b": 2
        },
        {
          "a": 2,
          "b": 1
        }
      ],
      "result": [
        {
          "a": 1
        },
        {
          "b": 2
        }
      ],
      "result_paths": [
        "$[0]",
        "$[1]"
      ],
      "tags": [
        "whitespace",
        "function",
        "count"
      ]
    },
    {
      "name": "tab between arg and parenthesis",
      "selector": "$[?count(@.*\t)==1]",
      "document": [
        {
          "a": 1
        },
        {
          "b": 2
        },
        {
          "a": 2,
          "b": 1
        }
      ],
      "result": [
        {
          "a": 1
        },
        {
          "b": 2
        }
      ],
      "result_paths": [
        "$[0]",
        "$[1]"
      ],
      "tags": [
        "whitespace",
        "function",
        "count"
      ]
    },
    {
      "name": "return between arg and parenthesis",
      "selector": "$[?count(@.*\r)==1]",
      "document": [
        {
          "a": 1
        },
        {
          "b": 2
        },
        {
          "a": 2,
          "b": 1
        }
      ],
      "result": [
        {
          "a": 1
        },
        {
          "b": 2
        }
      ],
      "result_paths": [
        "$[0]",
        "$[1]"
      ],
      "tags": [
        "whitespace",
        "function",
        "count"
      ]
    },
    {
      "name": "spaces in a relative singular selector",
      "selector": "$[?length(@ .a .b) == 3]",
      "document": [
        {
          "a": {
            "b": "foo"
          }
        },
        {}
      ],
      "result": [
        {
          "a": {
            "b": "foo"
          }
        }
      ],
      "result_paths": [
        "$[0]"
      ],
      "tags": [
        "whitespace",
        "function",
        "length"
      ]
    },
    {
      "name": "newlines in a relative singular selector",
      "selector": "$[?length(@\n.a\n.b) == 3]",
      "document": [
        {
          "a": {
            "b": "foo"
          }
        },
        {}
      ],
      "result": [
        {
          "a": {
            "b": "foo"
          }
        }
      ],
      "result_paths": [
        "$[0]"
      ],
      "tags": [
        "whitespace",
        "function",
        "length"
      ]
    },
    {
      "name": "tabs in a relative singular selector",
      "selector": "$[?length(@\t.a\t.b) == 3]",
      "document": [
        {
          "a": {
            "b": "foo"
          }
        },
        {}
      ],
      "result": [
        {
          "a": {
            "b": "foo"
          }
        }
      ],
      "result_paths": [
        "$[0]"
      ],
      "tags": [
        "whitespace",
        "function",
        "length"
      ]
    },
    {
      "name": "returns in a relative singular selector",
      "selector": "$[?length(@\r.a\r.b) == 3]",
      "document": [
        {
          "a": {
            "b": "foo"
          }
        },
        {}
      ],
      "result": [
        {
          "a": {
            "b": "foo"
          }
        }
      ],
      "result_paths": [
        "$[0]"
      ],
      "tags": [
        "whitespace",
        "function",
        "length"
      ]
    },
    {
      "name": "spaces in an absolute singular selector",
      "selector": "$..[?length(@)==length($ [0] .a)]",
      "document": [
        {
          "a": "foo"
        },
        {}
      ],
      "result": [
        "foo"
      ],
      "result_paths": [
        "$[0]['a']"
      ],
      "tags": [
        "whitespace",
        "function",
        "length"
      ]
    },
    {
      "name": "newlines in an absolute singular selector",
      "selector": "$..[?length(@)==length($\n[0]\n.a)]",
      "document": [
        {
          "a": "foo"
        },
        {}
      ],
      "result": [
        "foo"
      ],
      "result_paths": [
        "$[0]['a']"
      ],
      "tags": [
        "whitespace",
        "function",
        "length"
      ]
    },
    {
      "name": "tabs in an absolute singular selector",
      "selector": "$..[?length(@)==length($\t[0]\t.a)]",
      "document": [
        {
          "a": "foo"
        },
        {}
      ],
      "result": [
        "foo"
      ],
      "result_paths": [
        "$[0]['a']"
      ],
      "tags": [
        "whitespace",
        "function",
        "length"
      ]
    },
    {
      "name": "returns in an absolute singular selector",
      "selector": "$..[?length(@)==length($\r[0]\r.a)]",
      "document": [
        {
          "a": "foo"
        },
        {}
      ],
      "result": [
        "foo"
      ],
      "result_paths": [
        "$[0]['a']"
      ],
      "tags": [
        "whitespace",
        "function",
        "length"
      ]
    }
  ]
}