Parcourir la source

[5363] Added chained ifelse unit test

Francis Dupont il y a 7 ans
Parent
commit
866885465b
1 fichiers modifiés avec 7 ajouts et 0 suppressions
  1. 7 0
      src/lib/eval/tests/evaluate_unittest.cc

+ 7 - 0
src/lib/eval/tests/evaluate_unittest.cc

@@ -497,6 +497,13 @@ TEST_F(ExpressionsTest, evaluateString) {
                          "ifelse(option[100].exists,'foo','bar')", "foo");
     testExpressionString(Option::V4,
                          "ifelse(option[200].exists,'foo','bar')", "bar");
+
+    // Check that ifelse can be chained.
+    testExpressionString(Option::V4,
+                         "ifelse(option[200].exists,option[200].hex,"
+                                 "ifelse(option[100].exists,"
+                                         "option[100].hex,'none???'))",
+                         "hundred4");
 }
 
 };