]> granicus.if.org Git - icinga2/commitdiff
Implement more unit tests for typeof()
authorGunnar Beutner <gunnar@beutner.name>
Tue, 9 Dec 2014 15:46:29 +0000 (16:46 +0100)
committerGunnar Beutner <gunnar@beutner.name>
Tue, 9 Dec 2014 15:46:29 +0000 (16:46 +0100)
refs #8028

test/config-ops.cpp

index 7d62e3aa2d7dd59d5d2d5630c110d29554269578..f2bacebefa02ae1f598934478b2d119324b8c1d4 100644 (file)
@@ -254,6 +254,14 @@ BOOST_AUTO_TEST_CASE(advanced)
        expr = ConfigCompiler::CompileText("<test>", "typeof({}) == Dictionary");
        BOOST_CHECK(expr->Evaluate(frame));
        delete expr;
+
+       expr = ConfigCompiler::CompileText("<test>", "typeof(3) == Number");
+       BOOST_CHECK(expr->Evaluate(frame));
+       delete expr;
+
+       expr = ConfigCompiler::CompileText("<test>", "typeof(\"test\") == String");
+       BOOST_CHECK(expr->Evaluate(frame));
+       delete expr;
 }
 
 BOOST_AUTO_TEST_SUITE_END()