Socket/Protocols/Raw: EUI64 documentation
[senf.git] / Utils / Console / Parse.test.cc
index 7b9e7be..5d625e3 100644 (file)
@@ -21,7 +21,7 @@
 // 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 
 /** \file
-    \brief Parse.test unit tests */
+    \brief Parse unit tests */
 
 //#include "Parse.test.hh"
 //#include "Parse.test.ih"
@@ -200,7 +200,7 @@ BOOST_AUTO_UNIT_TEST(commandParser)
         "                   0304\";"
         "ls /foo/bar; ";
 
-    BOOST_CHECK_NO_THROW( parser.parse(text, &setInfo) );
+    SENF_CHECK_NO_THROW( parser.parse(text, &setInfo) );
     BOOST_CHECK_EQUAL( commands.size(), 2u );
 
     {
@@ -214,6 +214,7 @@ BOOST_AUTO_UNIT_TEST(commandParser)
 
         BOOST_CHECK_EQUAL_COLLECTIONS( info.commandPath().begin(), info.commandPath().end(),
                                        path, path + sizeof(path)/sizeof(path[0]) );
+        BOOST_CHECK_EQUAL( boost::next(info.commandPath().begin())->index(), 16u );
         BOOST_CHECK_EQUAL( unsigned(info.tokens().size()), 15u );
         
         char const * tokens[] = { "arg", 
@@ -243,11 +244,15 @@ BOOST_AUTO_UNIT_TEST(commandParser)
         BOOST_REQUIRE_EQUAL( args->size(), 8u );
         for (unsigned i (0); i<8; ++i)
             BOOST_CHECK_EQUAL( args->begin()[i].value(), tokens[4+i] );
+        BOOST_CHECK_EQUAL( info.tokens().begin()[3].index(), 96u );
+        BOOST_CHECK_EQUAL( info.tokens().begin()[5].index(), 98u );
+        BOOST_CHECK_EQUAL( info.tokens().begin()[12].index(), 109u );
         
         ++ args;
         BOOST_REQUIRE( args != info.arguments().end() );
         BOOST_REQUIRE_EQUAL( args->size(), 1u );
         BOOST_CHECK_EQUAL( args->begin()->value(), tokens[13] );
+        BOOST_CHECK_EQUAL( args->begin()->index(), 126u );
         
         ++ args;
         BOOST_REQUIRE( args != info.arguments().end() );
@@ -274,14 +279,14 @@ BOOST_AUTO_UNIT_TEST(checkedArgumentIterator)
 {
     senf::console::CommandParser parser;
 
-    BOOST_CHECK_NO_THROW( parser.parse("foo a", &setInfo) );
+    SENF_CHECK_NO_THROW( parser.parse("foo a", &setInfo) );
     BOOST_CHECK_THROW( parseArgs(commands.back().arguments()), 
                        senf::console::SyntaxErrorException );
 
-    BOOST_CHECK_NO_THROW( parser.parse("foo a b", &setInfo) );
-    BOOST_CHECK_NO_THROW( parseArgs(commands.back().arguments()) );
+    SENF_CHECK_NO_THROW( parser.parse("foo a b", &setInfo) );
+    SENF_CHECK_NO_THROW( parseArgs(commands.back().arguments()) );
 
-    BOOST_CHECK_NO_THROW( parser.parse("foo a b c", &setInfo) );
+    SENF_CHECK_NO_THROW( parser.parse("foo a b c", &setInfo) );
     BOOST_CHECK_THROW( parseArgs(commands.back().arguments()), 
                        senf::console::SyntaxErrorException );