• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*=============================================================================
2     Copyright (c) 2001-2011 Joel de Guzman
3     Copyright (c) 2001-2011 Hartmut Kaiser
4     http://spirit.sourceforge.net/
5 
6     Distributed under the Boost Software License, Version 1.0. (See accompanying
7     file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
8 =============================================================================*/
9 #include <boost/detail/lightweight_test.hpp>
10 #include <boost/detail/workaround.hpp>
11 #include <boost/spirit/include/qi_string.hpp>
12 #include <boost/spirit/include/qi_char.hpp>
13 #include <boost/spirit/include/qi_action.hpp>
14 #include <boost/spirit/include/phoenix_core.hpp>
15 #include <boost/spirit/include/phoenix_operator.hpp>
16 
17 #include <iostream>
18 #include "test.hpp"
19 
20 int
main()21 main()
22 {
23     using spirit_test::test;
24     using spirit_test::test_attr;
25     using boost::spirit::qi::lit;
26     using boost::spirit::qi::_1;
27 
28     {
29         BOOST_TEST((test("kimpo", lit("kimpo"))));
30 
31         std::basic_string<char> s("kimpo");
32         std::basic_string<wchar_t> ws(L"kimpo");
33         BOOST_TEST((test("kimpo", lit(s))));
34         BOOST_TEST((test(L"kimpo", lit(ws))));
35     }
36 
37     {
38         std::basic_string<char> s("kimpo");
39         BOOST_TEST((test("kimpo", lit(s))));
40 
41         std::basic_string<wchar_t> ws(L"kimpo");
42         BOOST_TEST((test(L"kimpo", lit(ws))));
43     }
44 
45     {
46         using namespace boost::spirit::ascii;
47         BOOST_TEST((test("    kimpo", lit("kimpo"), space)));
48         BOOST_TEST((test(L"    kimpo", lit(L"kimpo"), space)));
49     }
50 
51     {
52         using namespace boost::spirit::ascii;
53         BOOST_TEST((test("    kimpo", lit("kimpo"), space)));
54         BOOST_TEST((test(L"    kimpo", lit(L"kimpo"), space)));
55     }
56 
57     return boost::report_errors();
58 }
59