Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r56592 - in trunk/libs/spirit/test: karma qi
From: hartmut.kaiser_at_[hidden]
Date: 2009-10-05 08:13:03


Author: hkaiser
Date: 2009-10-05 08:13:02 EDT (Mon, 05 Oct 2009)
New Revision: 56592
URL: http://svn.boost.org/trac/boost/changeset/56592

Log:
Spirit: finalizing transform_attribute for rules, more tests
Text files modified:
   trunk/libs/spirit/test/karma/alternative.cpp | 8 ++++++++
   trunk/libs/spirit/test/qi/alternative.cpp | 6 ++++++
   2 files changed, 14 insertions(+), 0 deletions(-)

Modified: trunk/libs/spirit/test/karma/alternative.cpp
==============================================================================
--- trunk/libs/spirit/test/karma/alternative.cpp (original)
+++ trunk/libs/spirit/test/karma/alternative.cpp 2009-10-05 08:13:02 EDT (Mon, 05 Oct 2009)
@@ -79,6 +79,14 @@
         BOOST_TEST(test_delimited("c ", int_ | char_ | lit('a'), v, char_(' ')));
     }
 
+// {
+// variant<int, std::string> v(10);
+// BOOST_TEST(test("10", int_ | +char_, v));
+//
+// v = "abc";
+// BOOST_TEST(test("abc", int_ | +char_, v));
+// }
+
     {
         // if nothing matches, the first explicit alternative will be chosen
         variant<double, char const*> v (10.0);

Modified: trunk/libs/spirit/test/qi/alternative.cpp
==============================================================================
--- trunk/libs/spirit/test/qi/alternative.cpp (original)
+++ trunk/libs/spirit/test/qi/alternative.cpp 2009-10-05 08:13:02 EDT (Mon, 05 Oct 2009)
@@ -104,6 +104,12 @@
         boost::variant<int, std::string> v;
         BOOST_TEST((test_attr("12345", int_ | +char_, v)));
         BOOST_TEST(boost::get<int>(v) == 12345);
+//
+// BOOST_TEST((test_attr("abc", int_ | +char_, v)));
+// BOOST_TEST(boost::get<std::string>(v) == "abc");
+//
+// BOOST_TEST((test_attr("12345", +char_ | int_, v)));
+// BOOST_TEST(boost::get<std::string>(v) == "12345");
     }
 
     { // test action


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