X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=Console%2FParse.test.cc;h=491866af55a9f2811b93bbee39f7aa39d701a2c4;hb=2d5a1fd2cef2d84e16226a7336948f524fbb71c6;hp=3f83d57265064480e2825ce5b9f85846af3168f5;hpb=c0b5c560da72983939b286632ac481e076649ddb;p=senf.git diff --git a/Console/Parse.test.cc b/Console/Parse.test.cc index 3f83d57..491866a 100644 --- a/Console/Parse.test.cc +++ b/Console/Parse.test.cc @@ -43,8 +43,6 @@ namespace { - - struct TestParseDispatcher { TestParseDispatcher(std::ostream & os) : os_ (os) {} @@ -75,9 +73,11 @@ namespace void builtin_cd(std::vector const & path) { os_ << "builtin_cd( " << senf::stringJoin(path, "/") << " )\n"; } void builtin_ls(std::vector const & path) - { os_ << "builtin_cd( " << senf::stringJoin(path, "/") << " )\n"; } + { os_ << "builtin_ls( " << senf::stringJoin(path, "/") << " )\n"; } void builtin_exit() { os_ << "builtin_exit()\n"; } + void builtin_help(std::vector const & path) + { os_ << "builtin_help( " << senf::stringJoin(path, "/") << " )\n"; } }; } @@ -98,7 +98,12 @@ BOOST_AUTO_UNIT_TEST(commandGrammar) " (a,b,c (huhu))" " \"foo\\\"bar\" #\n" " x\"01 02 # Inner comment\n" - " 0304\""; + " 0304\";" + "ls /foo/bar;" + "cd /foo/bar;" + "exit;" + "foo/bar/ { ls; }" + "help /foo/bar"; BOOST_CHECK( boost::spirit::parse( text, @@ -121,7 +126,14 @@ BOOST_AUTO_UNIT_TEST(commandGrammar) "closeGroup()\n" "pushArgument( foo\"bar )\n" "pushArgument( \x01\x02\x03\x04 )\n" - "endCommand()\n" ); + "endCommand()\n" + "builtin_ls( /foo/bar )\n" + "builtin_cd( /foo/bar )\n" + "builtin_exit()\n" + "pushDirectory( foo/bar/ )\n" + "builtin_ls( )\n" + "popDirectory()\n" + "builtin_help( /foo/bar )\n" ); } namespace {