mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Updated Whiskers for checking invalid tags
For Example, raise an error if it contains invalid tags like <?ba<!b</b
This commit is contained in:
@@ -88,8 +88,34 @@ BOOST_AUTO_TEST_CASE(conditional_with_else)
|
||||
BOOST_AUTO_TEST_CASE(broken_conditional_with_else)
|
||||
{
|
||||
string templ = "<?b>X<!bY</b>";
|
||||
BOOST_CHECK_EQUAL(Whiskers(templ)("b", true).render(), "X<!bY");
|
||||
BOOST_CHECK_EQUAL(Whiskers(templ)("b", false).render(), "");
|
||||
BOOST_CHECK_THROW(Whiskers{templ}, WhiskersError);
|
||||
|
||||
templ = "<?bX<!b>Y</b>";
|
||||
BOOST_CHECK_THROW(Whiskers{templ}, WhiskersError);
|
||||
|
||||
templ = "<?b>X<!b>Y</b";
|
||||
BOOST_CHECK_THROW(Whiskers{templ}, WhiskersError);
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(broken_conditional_value_with_else)
|
||||
{
|
||||
string templ = "<?+b>X<!+bY</+b>";
|
||||
BOOST_CHECK_THROW(Whiskers{templ}, WhiskersError);
|
||||
|
||||
templ = "<?+bX<!+b>Y</+b>";
|
||||
BOOST_CHECK_THROW(Whiskers{templ}, WhiskersError);
|
||||
|
||||
templ = "<?+b>X<!+b>Y</+b";
|
||||
BOOST_CHECK_THROW(Whiskers{templ}, WhiskersError);
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(broken_list_parameter)
|
||||
{
|
||||
string templ = "<#b><a></b";
|
||||
BOOST_CHECK_THROW(Whiskers{templ}, WhiskersError);
|
||||
|
||||
templ = "<#b<a></b>";
|
||||
BOOST_CHECK_THROW(Whiskers{templ}, WhiskersError);
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(conditional_plus_params)
|
||||
|
||||
Reference in New Issue
Block a user