• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 //  Copyright (c) 2001-2011 Hartmut Kaiser
2 //
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/config/warning_disable.hpp>
7 #include <boost/detail/lightweight_test.hpp>
8 
9 #include <boost/spirit/include/karma_generate.hpp>
10 #include <boost/spirit/include/karma_operator.hpp>
11 #include <boost/spirit/include/karma_auxiliary.hpp>
12 #include <boost/spirit/include/karma_char.hpp>
13 #include <boost/spirit/include/karma_string.hpp>
14 
15 #include <iostream>
16 #include "test.hpp"
17 
18 int
main()19 main()
20 {
21     using namespace spirit_test;
22     using namespace boost::spirit;
23 
24     {
25         using boost::spirit::ascii::char_;
26         using boost::spirit::ascii::string;
27 
28         BOOST_TEST(test("c", !char_('a') << 'b' | 'c', 'a'));
29         BOOST_TEST(test("b", !char_('a') << 'b' | 'c', 'x'));
30 
31         BOOST_TEST(test("def", !string("123") << "abc" | "def", "123"));
32         BOOST_TEST(test("abc", !string("123") << "abc" | "def", "456"));
33     }
34 
35     return boost::report_errors();
36 }
37