@Test
    public void testParsing() throws ParseException {
        assertParse("3.14 > 0");
        assertParse("-999 > 0");
        assertParse("150000.0 > 0", "15e4 > 0");
        assertParse("3.4E-4 > 0", "3.4e-4 > 0");
        assertParse("\" Test \" = \"*\"");
        assertParse("id = \"*\"", "id = '*'");
        assertParse("id.group == 3");
        assertParse("id.namespace = \"*\"");
        assertParse("id.hash() > 0");
        assertParse("id.namespace.hash() > 0");
        assertParse("music.artist = \"*\"");
        assertParse("music.artist = \"&\"");
        assertParse("music.artist.lowercase() = \"*\"");
        assertParse("music_.artist = \"*\"");
        assertParse("music_foo.artist = \"*\"");
        assertParse("music_foo_.artist = \"*\"");
        assertParse("truth");
        assertParse("(4 + 3) > 0", "(4+3) > 0");
        assertParse("1 + 1 > 0", "1 +1 > 0");
        assertParse("1 + -1 > 0", "1 + -1 > 0");
        assertParse("1 + 1.0 > 0", "1 + +1.0 > 0");
        assertParse("1 - 1 > 0", "1 -1 > 0");
        assertParse("1 - -1 > 0", "1 - -1 > 0");
        assertParse("1 - 1.0 > 0", "1 - +1.0 > 0");
        assertParse("1 + 2 * 3 - 10 % 2 / 3 > 0", "1   +2 *  3- 10%2   /3  > 0");
        assertParse("((43 + 14) / 34) > 0");
        assertParse("(34 * ((3 - 1) % 4)) > 0");
        assertParse("true");
        assertParse("false");
        assertParse("music");
        assertParse("(music or book)");
        assertParse("music or book", "music or book");
        assertParse("(music or (book and video))");
        assertParse("music or (book and video)", "music or (book and video)");
        assertParse("((music or book) and video)");
        assertParse("(music or book) and video", "(music or book) and video");
        assertParse("music.test > 0");
        assertParse("music.artist = \"*john*\"");
        assertParse("music.length >= 180");
        assertParse("true or not false and true", "true oR nOt false And true");
        assertParse("(true or false) and true", "(true oR false) aNd true");
        assertParse("music.expire > now()");
        assertParse("music.expire > now() - 300");
        assertParse("now or now_search");
        assertParse("(music.expire / 1000) > (now() - 300)");
    }
@author Simon Thoresen Hult
@author bratseth
document/src/test/java/com/yahoo/document/select/DocumentSelectorTestCase.java