merged changes in regex5 branch

[SVN r26692]
This commit is contained in:
John Maddock
2005-01-13 17:06:21 +00:00
parent de0ab9092a
commit 71a0e020e2
275 changed files with 37305 additions and 27154 deletions

View File

@ -0,0 +1,46 @@
#include "test.hpp"
#define BOOST_REGEX_TEST(x)\
if(!(x)){ BOOST_REGEX_TEST_ERROR("Error in: " BOOST_STRINGIZE(x), char); }
void test_overloads()
{
test_info<char>::set_typename("sub_match operators");
// test all the available overloads with *one* simple
// expression, doing all these tests with all the test
// cases would just take to long...
boost::regex e("abc");
std::string s("abc");
const std::string& cs = s;
boost::smatch sm;
boost::cmatch cm;
// regex_match:
BOOST_REGEX_TEST(boost::regex_match(cs.begin(), cs.end(), sm, e))
BOOST_REGEX_TEST(boost::regex_match(cs.begin(), cs.end(), sm, e, boost::regex_constants::match_default))
BOOST_REGEX_TEST(boost::regex_match(cs.begin(), cs.end(), e))
BOOST_REGEX_TEST(boost::regex_match(cs.begin(), cs.end(), e, boost::regex_constants::match_default))
BOOST_REGEX_TEST(boost::regex_match(s.c_str(), cm, e))
BOOST_REGEX_TEST(boost::regex_match(s.c_str(), cm, e, boost::regex_constants::match_default))
BOOST_REGEX_TEST(boost::regex_match(s.c_str(), e))
BOOST_REGEX_TEST(boost::regex_match(s.c_str(), e, boost::regex_constants::match_default))
BOOST_REGEX_TEST(boost::regex_match(s, sm, e))
BOOST_REGEX_TEST(boost::regex_match(s, sm, e, boost::regex_constants::match_default))
BOOST_REGEX_TEST(boost::regex_match(s, e))
BOOST_REGEX_TEST(boost::regex_match(s, e, boost::regex_constants::match_default))
// regex_search:
BOOST_REGEX_TEST(boost::regex_search(cs.begin(), cs.end(), sm, e))
BOOST_REGEX_TEST(boost::regex_search(cs.begin(), cs.end(), sm, e, boost::regex_constants::match_default))
BOOST_REGEX_TEST(boost::regex_search(cs.begin(), cs.end(), e))
BOOST_REGEX_TEST(boost::regex_search(cs.begin(), cs.end(), e, boost::regex_constants::match_default))
BOOST_REGEX_TEST(boost::regex_search(s.c_str(), cm, e))
BOOST_REGEX_TEST(boost::regex_search(s.c_str(), cm, e, boost::regex_constants::match_default))
BOOST_REGEX_TEST(boost::regex_search(s.c_str(), e))
BOOST_REGEX_TEST(boost::regex_search(s.c_str(), e, boost::regex_constants::match_default))
BOOST_REGEX_TEST(boost::regex_search(s, sm, e))
BOOST_REGEX_TEST(boost::regex_search(s, sm, e, boost::regex_constants::match_default))
BOOST_REGEX_TEST(boost::regex_search(s, e))
BOOST_REGEX_TEST(boost::regex_search(s, e, boost::regex_constants::match_default))
}