X-Git-Url: https://git.tokkee.org/?p=sysdb.git;a=blobdiff_plain;f=t%2Funit%2Ffrontend%2Fparser_test.c;h=c5b514fde5156fa43fafed5a714e6ffbd2e768cf;hp=2368bcc4d3efe821a5342aa25ee07316ff69e7e1;hb=4d93f084bf26672e322b82ce192c8beb5765e1d0;hpb=1dd3ecefb29aa3e4dfff7a545343d64b00f4e783 diff --git a/t/unit/frontend/parser_test.c b/t/unit/frontend/parser_test.c index 2368bcc..c5b514f 100644 --- a/t/unit/frontend/parser_test.c +++ b/t/unit/frontend/parser_test.c @@ -186,6 +186,12 @@ START_TEST(test_parse) "1Y42D", -1, 1, SDB_CONNECTION_LOOKUP }, */ + /* array constants */ + { "LOOKUP hosts MATCHING " + "backend = ['foo']", -1, 1, SDB_CONNECTION_LOOKUP }, + { "LOOKUP hosts MATCHING " + "backend = ['a','b']", -1, 1, SDB_CONNECTION_LOOKUP }, + /* NULL */ { "LOOKUP hosts MATCHING " "attribute['foo'] " @@ -452,6 +458,14 @@ START_TEST(test_parse_matcher) * IS NULL currently maps to an equality matcher */ { "attribute['foo'] IS NULL", -1, MATCHER_ISNULL }, { "attribute['foo'] IS NOT NULL", -1, MATCHER_ISNNULL }, + /* array expressions */ + { "backend < ['a']", -1, MATCHER_LT }, + { "backend <= ['a']", -1, MATCHER_LE }, + { "backend = ['a']", -1, MATCHER_EQ }, + { "backend != ['a']", -1, MATCHER_NE }, + { "backend >= ['a']", -1, MATCHER_GE }, + { "backend > ['a']", -1, MATCHER_GT }, + { "backend &^ ['a']", -1, -1 }, /* object field matchers */ { "name < 'a'", -1, MATCHER_LT },