X-Git-Url: https://git.tokkee.org/?p=sysdb.git;a=blobdiff_plain;f=t%2Ffrontend%2Fparser_test.c;h=4b177328c084483edc1c74d7e167cf89533a8db3;hp=212bfe1d44d4d47356b8b775d34ce47be39eb351;hb=ddb641105e8c3f14622d3def263f654a71015168;hpb=c63a274a489e53a9e84e9772839a16a1c2a3b2b8 diff --git a/t/frontend/parser_test.c b/t/frontend/parser_test.c index 212bfe1..4b17732 100644 --- a/t/frontend/parser_test.c +++ b/t/frontend/parser_test.c @@ -57,8 +57,8 @@ START_TEST(test_parse) { "LIST;", -1, 1, CONNECTION_LIST }, { "LIST; INVALID", 5, 1, CONNECTION_LIST }, - { "LOOKUP hosts " - "WHERE 'host'", -1, 1, CONNECTION_LOOKUP }, + { "LOOKUP hosts WHERE " + "host.name = 'host'", -1, 1, CONNECTION_LOOKUP }, /* comments */ { "/* some comment */", -1, 0, 0 }, @@ -71,8 +71,8 @@ START_TEST(test_parse) { "/* some incomplete", -1, -1, 0 }, { "LOOKUP hosts", -1, -1, 0 }, - { "LOOKUP invalid " - "WHERE 'host'", -1, -1, 0 }, + { "LOOKUP foo WHERE " + "host.name = 'host'", -1, -1, 0 }, }; size_t i; @@ -120,17 +120,17 @@ START_TEST(test_parse_matcher) int expected; } golden_data[] = { /* empty expressions */ - { NULL, -1, -1 }, - { "", -1, -1 }, + { NULL, -1, -1 }, + { "", -1, -1 }, /* valid expressions */ - { "'localhost'", -1, 0 }, - { "'localhost' -- foo", -1, 0 }, - { "'host' ", 6, 0 }, + { "host.name = 'localhost'", -1, 0 }, + { "host.name = 'localhost' -- foo", -1, 0 }, + { "host.name = 'host' ", 18, 0 }, /* syntax errors */ - { "LIST", -1, -1 }, - { "foo &^ bar", -1, -1 }, + { "LIST", -1, -1 }, + { "foo &^ bar", -1, -1 }, }; size_t i;