]> granicus.if.org Git - icinga2/blob - test/base-match.cpp
Merge pull request #6999 from Icinga/bugfix/compiler-warnings
[icinga2] / test / base-match.cpp
1 /* Icinga 2 | (c) 2012 Icinga GmbH | GPLv2+ */
2
3 #include "base/utility.hpp"
4 #include <BoostTestTargetConfig.h>
5
6 using namespace icinga;
7
8 BOOST_AUTO_TEST_SUITE(base_match)
9
10 BOOST_AUTO_TEST_CASE(tolong)
11 {
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"));
25 }
26
27 BOOST_AUTO_TEST_SUITE_END()