|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r57930 - trunk/libs/spirit/test/qi
From: hartmut.kaiser_at_[hidden]
Date: 2009-11-25 18:18:03
Author: hkaiser
Date: 2009-11-25 18:18:02 EST (Wed, 25 Nov 2009)
New Revision: 57930
URL: http://svn.boost.org/trac/boost/changeset/57930
Log:
Spirit: reverted latest change
Text files modified:
trunk/libs/spirit/test/qi/alternative.cpp | 19 +++++++++++++------
trunk/libs/spirit/test/qi/kleene.cpp | 8 +-------
2 files changed, 14 insertions(+), 13 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-11-25 18:18:02 EST (Wed, 25 Nov 2009)
@@ -49,11 +49,13 @@
, boost::spirit::unused_type
, boost::spirit::unused_type) const
{
- BOOST_TEST(v.size() == 4 &&
- v[0] == 'a' &&
- v[1] == 'b' &&
- v[2] == '1' &&
- v[3] == '2');
+ using boost::get;
+
+ BOOST_TEST(v.size() == 5 &&
+ v[1] == 'a' &&
+ v[2] == 'b' &&
+ v[3] == '1' &&
+ v[4] == '2');
}
};
@@ -172,6 +174,7 @@
using boost::spirit::ascii::string;
namespace phx = boost::phoenix;
+
BOOST_TEST( (test("ab1_", (*(alnum | char_('_')))[test_action('_')])) );
BOOST_TEST( (test("ab12", (*(alpha | digit))[test_action('2')])) );
@@ -179,7 +182,11 @@
std::vector<boost::optional<char> > v;
BOOST_TEST( (test("x,y,z", (*(',' | char_))[phx::ref(v) = _1])) );
- BOOST_TEST(v.size() == 3 && v[0] == 'x' && v[1] == 'y' && v[2] == 'z');
+ assert(v[0] == 'x');
+ assert(!v[1]);
+ assert(v[2] == 'y');
+ assert(!v[3]);
+ assert(v[4] == 'z');
}
{
Modified: trunk/libs/spirit/test/qi/kleene.cpp
==============================================================================
--- trunk/libs/spirit/test/qi/kleene.cpp (original)
+++ trunk/libs/spirit/test/qi/kleene.cpp 2009-11-25 18:18:02 EST (Wed, 25 Nov 2009)
@@ -106,19 +106,13 @@
BOOST_TEST(test_attr("123 456 789 10", *int_, v, space) && 4 == v.size() &&
v[0] == 123 && v[1] == 456 && v[2] == 789 && v[3] == 10);
}
-
+
{
std::vector<std::string> v;
BOOST_TEST(test_attr("a b c d", *lexeme[+alpha], v, space) && 4 == v.size() &&
v[0] == "a" && v[1] == "b" && v[2] == "c" && v[3] == "d");
}
-// {
-// std::vector<char> v;
-// BOOST_TEST(test_attr("abc", *('a' | char_), v));
-// BOOST_TEST(v.size() == 2 && v[0] == 'b' && v[1] == 'c');
-// }
-
{
std::vector<int> v;
BOOST_TEST(test_attr("123 456 789", *int_, v, space) && 3 == v.size() &&
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