eol.cpp 861 B

1234567891011121314151617181920212223242526272829303132
  1. /*=============================================================================
  2. Copyright (c) 2001-2015 Joel de Guzman
  3. Distributed under the Boost Software License, Version 1.0. (See accompanying
  4. file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  5. =============================================================================*/
  6. #include <boost/detail/lightweight_test.hpp>
  7. #include <boost/spirit/home/x3.hpp>
  8. #include <iostream>
  9. #include "test.hpp"
  10. int
  11. main()
  12. {
  13. using spirit_test::test;
  14. using boost::spirit::x3::eol;
  15. {
  16. BOOST_TEST((test("\r\n", eol)));
  17. BOOST_TEST((test("\r", eol)));
  18. BOOST_TEST((test("\n", eol)));
  19. BOOST_TEST((!test("\n\r", eol)));
  20. BOOST_TEST((!test("", eol)));
  21. }
  22. {
  23. BOOST_TEST(what(eol) == "eol");
  24. }
  25. return boost::report_errors();
  26. }