Packets: Add StringParser ostream operation
[senf.git] / Utils / Console / Parse.test.cc
index 5d625e3..bbc2c68 100644 (file)
@@ -66,6 +66,8 @@ namespace
             { os_ << "builtin_cd( " << senf::stringJoin(path, "/") << " )\n"; }
         void builtin_ls(std::vector<senf::console::Token> const & path)
             { os_ << "builtin_ls( " << senf::stringJoin(path, "/") << " )\n"; }
+        void builtin_lr(std::vector<senf::console::Token> const & path)
+            { os_ << "builtin_lr( " << senf::stringJoin(path, "/") << " )\n"; }
         void builtin_exit()
             { os_ << "builtin_exit()\n"; }
         void builtin_help(std::vector<senf::console::Token> const & path)
@@ -133,6 +135,15 @@ BOOST_AUTO_UNIT_TEST(commandGrammar)
     {
         ss.str("");
         BOOST_CHECK( boost::spirit::parse( 
+                         "lr /foo/bar;", 
+                         grammar.use_parser<Grammar::CommandParser>(), 
+                         grammar.use_parser<Grammar::SkipParser>() ) . full );
+        BOOST_CHECK_EQUAL( ss.str(), "builtin_lr( None('')/Word('foo')/Word('bar') )\n" );
+    }
+
+    {
+        ss.str("");
+        BOOST_CHECK( boost::spirit::parse( 
                          "cd /foo/bar;", 
                          grammar.use_parser<Grammar::CommandParser>(), 
                          grammar.use_parser<Grammar::SkipParser>() ) . full );