mirror of
https://github.com/CLIUtils/CLI11.git
synced 2025-05-03 05:53:52 +00:00
HorribleError for subcommand test
This commit is contained in:
parent
50ef31103f
commit
c50dd580bd
@ -1081,6 +1081,13 @@ struct AppFriend {
|
||||
return app->_parse_long(std::forward<Args>(args)...);
|
||||
}
|
||||
|
||||
/// Wrap _parse_subcommand, perfectly forward arguments and return
|
||||
template<typename ...Args>
|
||||
static auto parse_subcommand(App* app, Args && ...args)
|
||||
-> typename std::result_of<decltype(&App::_parse_subcommand)(App, Args...)>::type {
|
||||
return app->_parse_subcommand(std::forward<Args>(args)...);
|
||||
}
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -803,3 +803,10 @@ TEST_F(TApp, CheckLongFail) {
|
||||
|
||||
EXPECT_THROW(CLI::detail::AppFriend::parse_long(&app, args), CLI::HorribleError);
|
||||
}
|
||||
|
||||
// Test horrible error
|
||||
TEST_F(TApp, CheckSubcomFail) {
|
||||
args = {"subcom"};
|
||||
|
||||
EXPECT_THROW(CLI::detail::AppFriend::parse_long(&app, args), CLI::HorribleError);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user