Imported Upstream version 1.57.0
[platform/upstream/boost.git] / libs / spirit / test / x3 / lit.cpp
1 /*=============================================================================
2     Copyright (c) 2001-2013 Joel de Guzman
3
4     Distributed under the Boost Software License, Version 1.0. (See accompanying
5     file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
6 =============================================================================*/
7 #include <boost/detail/lightweight_test.hpp>
8 #include <boost/spirit/home/x3.hpp>
9
10 #include <string>
11
12 #include "test.hpp"
13
14 int
15 main()
16 {
17     using spirit_test::test_attr;
18     using boost::spirit::x3::lit;
19     using boost::spirit::x3::char_;
20
21     {
22         std::string attr;
23         auto p = char_ >> lit("\n");
24         BOOST_TEST(test_attr("A\n", p, attr));
25         BOOST_TEST(attr == "A");
26     }
27     return boost::report_errors();
28 }