test_dynamic.cpp 1021 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. ///////////////////////////////////////////////////////////////////////////////
  2. // test_dynamic.cpp
  3. //
  4. // Copyright 2008 Eric Niebler. Distributed under the Boost
  5. // Software License, Version 1.0. (See accompanying file
  6. // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  7. #include <boost/xpressive/xpressive_dynamic.hpp>
  8. #include <boost/test/unit_test.hpp>
  9. ///////////////////////////////////////////////////////////////////////////////
  10. // test_main
  11. void test_main()
  12. {
  13. using namespace boost::xpressive;
  14. std::string str("bar");
  15. sregex rx = sregex::compile("b.*ar");
  16. smatch what;
  17. if(!regex_match(str, what, rx))
  18. {
  19. BOOST_ERROR("oops");
  20. }
  21. }
  22. using namespace boost::unit_test;
  23. ///////////////////////////////////////////////////////////////////////////////
  24. // init_unit_test_suite
  25. //
  26. test_suite* init_unit_test_suite( int argc, char* argv[] )
  27. {
  28. test_suite *test = BOOST_TEST_SUITE("test_dynamic");
  29. test->add(BOOST_TEST_CASE(&test_main));
  30. return test;
  31. }