Code

parser_test: Added simple LOOKUP parser tests.
authorSebastian Harl <sh@tokkee.org>
Tue, 1 Apr 2014 21:03:43 +0000 (23:03 +0200)
committerSebastian Harl <sh@tokkee.org>
Tue, 1 Apr 2014 21:03:43 +0000 (23:03 +0200)
t/frontend/parser_test.c

index 8a2b2d50a8a5151809b99464d4f5551da44ffb0e..212bfe1d44d4d47356b8b775d34ce47be39eb351 100644 (file)
@@ -51,11 +51,14 @@ START_TEST(test_parse)
                { ";;",                 -1,  0, 0 },
 
                /* valid commands */
-               { "FETCH 'host'",       -1,  1, CONNECTION_FETCH },
-               { "LIST",               -1,  1, CONNECTION_LIST  },
-               { "LIST -- comment",    -1,  1, CONNECTION_LIST  },
-               { "LIST;",              -1,  1, CONNECTION_LIST  },
-               { "LIST; INVALID",       5,  1, CONNECTION_LIST  },
+               { "FETCH 'host'",       -1,  1, CONNECTION_FETCH  },
+               { "LIST",               -1,  1, CONNECTION_LIST   },
+               { "LIST -- comment",    -1,  1, CONNECTION_LIST   },
+               { "LIST;",              -1,  1, CONNECTION_LIST   },
+               { "LIST; INVALID",       5,  1, CONNECTION_LIST   },
+
+               { "LOOKUP hosts "
+                 "WHERE 'host'",       -1,  1, CONNECTION_LOOKUP },
 
                /* comments */
                { "/* some comment */", -1,  0, 0 },
@@ -66,6 +69,10 @@ START_TEST(test_parse)
                { "FETCH host",         -1, -1, 0 },
                { "LIST; INVALID",       8, -1, 0 },
                { "/* some incomplete", -1, -1, 0 },
+
+               { "LOOKUP hosts",       -1, -1, 0 },
+               { "LOOKUP invalid "
+                 "WHERE 'host'",       -1, -1, 0 },
        };
 
        size_t i;