Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r57401 - trunk/libs/spirit/test/qi
From: joel_at_[hidden]
Date: 2009-11-05 02:34:24


Author: djowel
Date: 2009-11-05 02:34:23 EST (Thu, 05 Nov 2009)
New Revision: 57401
URL: http://svn.boost.org/trac/boost/changeset/57401

Log:
symbols fix from Daniel James
Text files modified:
   trunk/libs/spirit/test/qi/symbols.cpp | 28 ++++++++++++++++++++++++++++
   1 files changed, 28 insertions(+), 0 deletions(-)

Modified: trunk/libs/spirit/test/qi/symbols.cpp
==============================================================================
--- trunk/libs/spirit/test/qi/symbols.cpp (original)
+++ trunk/libs/spirit/test/qi/symbols.cpp 2009-11-05 02:34:23 EST (Thu, 05 Nov 2009)
@@ -276,6 +276,34 @@
         BOOST_TEST(i == 2);
         BOOST_TEST(!test("c", r(phx::ref(sym))));
     }
+
+ { // find
+
+ symbols<char, int> sym;
+ sym.add("a", 1)("b", 2);
+
+ BOOST_TEST(!sym.find("c"));
+
+ BOOST_TEST(sym.find("a") && *sym.find("a") == 1);
+ BOOST_TEST(sym.find("b") && *sym.find("b") == 2);
+
+ BOOST_TEST(sym.at("a") == 1);
+ BOOST_TEST(sym.at("b") == 2);
+ BOOST_TEST(sym.at("c") == 0);
+
+ BOOST_TEST(sym.find("a") && *sym.find("a") == 1);
+ BOOST_TEST(sym.find("b") && *sym.find("b") == 2);
+ BOOST_TEST(sym.find("c") && *sym.find("c") == 0);
+
+ symbols<char, int> const_sym(sym);
+
+ BOOST_TEST(const_sym.find("a") && *const_sym.find("a") == 1);
+ BOOST_TEST(const_sym.find("b") && *const_sym.find("b") == 2);
+ BOOST_TEST(const_sym.find("c") && *const_sym.find("c") == 0);
+ BOOST_TEST(!const_sym.find("d"));
+
+
+ }
 
     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