Add unit tests for the typeof() operator

refs #8002
This commit is contained in:
Gunnar Beutner 2014-12-08 11:03:50 +01:00
parent a2bd3a9576
commit 37ffda131e
1 changed files with 8 additions and 0 deletions

View File

@ -246,6 +246,14 @@ BOOST_AUTO_TEST_CASE(advanced)
expr = ConfigCompiler::CompileText("<test>", "__function() { __return 3, 5 }()"); expr = ConfigCompiler::CompileText("<test>", "__function() { __return 3, 5 }()");
BOOST_CHECK(expr->Evaluate(frame) == 3); BOOST_CHECK(expr->Evaluate(frame) == 3);
delete expr; delete expr;
expr = ConfigCompiler::CompileText("<test>", "typeof([]) == Array");
BOOST_CHECK(expr->Evaluate(frame));
delete expr;
expr = ConfigCompiler::CompileText("<test>", "typeof({}) == Dictionary");
BOOST_CHECK(expr->Evaluate(frame));
delete expr;
} }
BOOST_AUTO_TEST_SUITE_END() BOOST_AUTO_TEST_SUITE_END()