2
0
mirror of https://github.com/boostorg/spirit.git synced 2026-01-19 04:42:11 +00:00
Files
spirit/classic/test/parser_context_test.cpp
Nikita Kniazev 6a7c758376 Switch to the new location of lightweight test
Old location had been deprecated for a long time already.
2021-08-23 21:45:17 +03:00

26 lines
836 B
C++

/*=============================================================================
Copyright (c) 2003 Vaclav Vesely
http://spirit.sourceforge.net/
Use, modification and distribution is subject to the Boost Software
License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
http://www.boost.org/LICENSE_1_0.txt)
=============================================================================*/
#include <boost/spirit/include/classic_core.hpp>
#include <boost/spirit/include/classic_assign_actor.hpp>
#include <boost/core/lightweight_test.hpp>
using namespace boost;
using namespace BOOST_SPIRIT_CLASSIC_NS;
int main()
{
rule<parser_context<int> > int_rule = int_p;
int result(0);
parse("123", int_rule[assign_a(result)]);
BOOST_TEST(result == 123);
return boost::report_errors();
}