Code

parser/analyzer: Migrate value expression checks.
[sysdb.git] / t / unit / parser / parser_test.c
index 68e152740368d029ba9dd3ad96acb5be9cd7c81d..f9049211440c513c342ce6c3769c7f160f8767bf 100644 (file)
@@ -409,8 +409,13 @@ struct {
         * syntactically correct but semantically invalid commands
         */
 
         * syntactically correct but semantically invalid commands
         */
 
-#if 0
        /* invalid fields */
        /* invalid fields */
+       { "LIST hosts FILTER "
+         "field = 'a'",           -1, -1, 0, 0 },
+       { "LIST services FILTER "
+         "field = 'a'",           -1, -1, 0, 0 },
+       { "LIST metrics FILTER "
+         "field = 'a'",           -1, -1, 0, 0 },
        { "LIST hosts FILTER "
          "value = 'a'",           -1, -1, 0, 0 },
        { "LIST services FILTER "
        { "LIST hosts FILTER "
          "value = 'a'",           -1, -1, 0, 0 },
        { "LIST services FILTER "
@@ -449,6 +454,7 @@ struct {
          "age + 1 > 0s",        -1, -1, 0, 0 },
        { "LOOKUP hosts MATCHING "
          "age - 1 > 0s",        -1, -1, 0, 0 },
          "age + 1 > 0s",        -1, -1, 0, 0 },
        { "LOOKUP hosts MATCHING "
          "age - 1 > 0s",        -1, -1, 0, 0 },
+
        /* datetime <mul/div> integer is allowed */
        { "LOOKUP hosts MATCHING "
          "age || 1 > 0s",       -1, -1, 0, 0 },
        /* datetime <mul/div> integer is allowed */
        { "LOOKUP hosts MATCHING "
          "age || 1 > 0s",       -1, -1, 0, 0 },
@@ -595,7 +601,6 @@ struct {
          "2015-02-01",          -1, -1, 0, 0 },
        { "STORE metric attribute "
          "'metric'.'key' 123",  -1, -1, 0, 0 },
          "2015-02-01",          -1, -1, 0, 0 },
        { "STORE metric attribute "
          "'metric'.'key' 123",  -1, -1, 0, 0 },
-#endif
 };
 
 START_TEST(test_parse)
 };
 
 START_TEST(test_parse)