|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r56565 - trunk/libs/spirit/test/qi
From: joel_at_[hidden]
Date: 2009-10-04 00:01:33
Author: djowel
Date: 2009-10-04 00:01:32 EDT (Sun, 04 Oct 2009)
New Revision: 56565
URL: http://svn.boost.org/trac/boost/changeset/56565
Log:
fixed alternative attribute handling
Text files modified:
trunk/libs/spirit/test/qi/alternative.cpp | 7 +++++++
trunk/libs/spirit/test/qi/list.cpp | 6 ------
2 files changed, 7 insertions(+), 6 deletions(-)
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-04 00:01:32 EDT (Sun, 04 Oct 2009)
@@ -98,6 +98,13 @@
BOOST_TEST((test_attr("x", lit("rock") | int_ | char_, v)));
BOOST_TEST(boost::get<char>(v) == 'x');
}
+
+ { // Make sure that we are using the actual supplied attribute types
+ // from the variant and not the expected type.
+ boost::variant<int, std::string> v;
+ BOOST_TEST((test_attr("12345", int_ | +char_, v)));
+ BOOST_TEST(boost::get<int>(v) == 12345);
+ }
{ // test action
Modified: trunk/libs/spirit/test/qi/list.cpp
==============================================================================
--- trunk/libs/spirit/test/qi/list.cpp (original)
+++ trunk/libs/spirit/test/qi/list.cpp 2009-10-04 00:01:32 EDT (Sun, 04 Oct 2009)
@@ -51,12 +51,6 @@
BOOST_TEST(test_attr("a,b,c,d,e,f,g,h", char_ % ',', s));
BOOST_TEST(s == "abcdefgh");
}
-
- {
- using boost::spirit::uint_;
-
- BOOST_TEST(test("1-2", (uint_ % '+') | (uint_ % '-')));
- }
{
using boost::spirit::int_;
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