Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r68746 - in trunk/libs/spirit/test: . support
From: hartmut.kaiser_at_[hidden]
Date: 2011-02-09 09:26:57


Author: hkaiser
Date: 2011-02-09 09:26:54 EST (Wed, 09 Feb 2011)
New Revision: 68746
URL: http://svn.boost.org/trac/boost/changeset/68746

Log:
Spirit: added one more test
Added:
   trunk/libs/spirit/test/support/utree_debug.cpp (contents, props changed)
Text files modified:
   trunk/libs/spirit/test/Jamfile | 3 ++-
   1 files changed, 2 insertions(+), 1 deletions(-)

Modified: trunk/libs/spirit/test/Jamfile
==============================================================================
--- trunk/libs/spirit/test/Jamfile (original)
+++ trunk/libs/spirit/test/Jamfile 2011-02-09 09:26:54 EST (Wed, 09 Feb 2011)
@@ -239,7 +239,8 @@
     ###########################################################################
     test-suite spirit_v2/support :
 
- [ run support/utree.cpp : : : : support_utree ]
+ [ run support/utree.cpp : : : : support_utree ]
+ [ run support/utree_debug.cpp : : : : support_utree_debug ]
 
     ;
 

Added: trunk/libs/spirit/test/support/utree_debug.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/spirit/test/support/utree_debug.cpp 2011-02-09 09:26:54 EST (Wed, 09 Feb 2011)
@@ -0,0 +1,29 @@
+// Copyright (c) 2001-2011 Hartmut Kaiser
+//
+// Distributed under 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/detail/lightweight_test.hpp>
+
+#define BOOST_SPIRIT_DEBUG 1
+
+#include <boost/spirit/include/qi.hpp>
+#include <boost/spirit/include/support_utree.hpp>
+
+#include <string>
+
+namespace qi = boost::spirit::qi;
+namespace spirit = boost::spirit;
+
+int main()
+{
+ qi::rule<std::string::iterator, spirit::utree()> r = qi::int_;
+ BOOST_SPIRIT_DEBUG_NODE(r);
+
+ spirit::utree ut;
+ std::string input("1");
+ BOOST_TEST(qi::parse(input.begin(), input.end(), r, ut));
+ BOOST_TEST(ut.which() == spirit::utree_type::int_type && ut.get<int>() == 1);
+
+ return boost::report_errors();
+}


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk