@Test
    void testIn() {
        parser = new SelectParser(new ParserEnvironment().setIndexFacts(createIndexFactsForInTest()));

        // Numeric
        Select selectNumeric = new Select("{\"in\" : [\"field\", 42, 22, -7, 26, 25, -11, 24]}", "", new Query());
        var query = parser.parse(new Parsable().setSelect(selectNumeric));
        assertNumericInItem("field", new long[]{-11, -7, 22, 24, 25, 26, 42}, query);

        // String
        Select selectString = new Select("{\"in\" : [\"string\", 'a','b', 'this', \"might\", \"work\"]}", "", new Query());
        query = parser.parse(new Parsable().setSelect(selectString));
        assertStringInItem("string", new String[]{"a","b","might","this", "work"}, query);

        assertParseFail("{\"in\" : [\"field\", 29.9, -7.4]}",
                new IllegalArgumentException("The field 'field' is an integer field, "
                        + "but the argument 29.9 is of type DOUBLE"));
        assertParseFail("{\"in\" : [\"string\", 'a', 25]}",
                new IllegalArgumentException("The field 'string' is a string field, "
                        + "but the argument 25 is of type LONG"));
        assertParseFail("{\"in\" : [\"field\", 'a', 25]}",
                new IllegalArgumentException("The field 'field' is an integer field, "
                        + "but the argument \"a\" is of type STRING"));
        assertParseFail("{\"in\" : [\"nofield\", 'a', 25]}",
                new IllegalArgumentException("Field 'nofield' does not exist."));
        assertParseFail("{\"not in\" : [\"field\", 25]}",
                new IllegalArgumentException("Expected and, and_not, call, contains, equals, in, matches, or or range, got not in."));
        assertParseFail("{\"in\" : [\"float\", 25]}",
                new IllegalArgumentException("The in operator is only supported for integer and string fields. " +
                        "The field 'float' is not of these types"));
        assertParseFail("{\"in\" : [\"mixed\", 25]}",
                new IllegalArgumentException("The in operator is not supported for fieldsets with a mix of integer " +
                        "and string fields. The fieldset 'mixed' has both"));
    }
Tests Query.Select

@author henrhoi
@author bratseth
container-search/src/test/java/com/yahoo/select/SelectTestCase.java