1 /* Icinga 2 | (c) 2012 Icinga GmbH | GPLv2+ */
3 #include "base/utility.hpp"
4 #include <BoostTestTargetConfig.h>
6 using namespace icinga;
8 BOOST_AUTO_TEST_SUITE(base_match)
10 BOOST_AUTO_TEST_CASE(tolong)
12 BOOST_CHECK(Utility::Match("*", "hello"));
13 BOOST_CHECK(!Utility::Match("\\**", "hello"));
14 BOOST_CHECK(Utility::Match("\\**", "*ello"));
15 BOOST_CHECK(Utility::Match("?e*l?", "hello"));
16 BOOST_CHECK(Utility::Match("?e*l?", "helo"));
17 BOOST_CHECK(!Utility::Match("world", "hello"));
18 BOOST_CHECK(!Utility::Match("hee*", "hello"));
19 BOOST_CHECK(Utility::Match("he??o", "hello"));
20 BOOST_CHECK(Utility::Match("he?", "hel"));
21 BOOST_CHECK(Utility::Match("he*", "hello"));
22 BOOST_CHECK(Utility::Match("he*o", "heo"));
23 BOOST_CHECK(Utility::Match("he**o", "heo"));
24 BOOST_CHECK(Utility::Match("he**o", "hello"));
27 BOOST_AUTO_TEST_SUITE_END()