Commit 87185a1879f5c0a282ac24c49f95978facaae2b5

Authored by Henry Fredrick Schreiner
1 parent 4af3faef

Adding callback success

Showing 1 changed file with 16 additions and 0 deletions
tests/SubcommandTest.cpp
@@ -306,3 +306,19 @@ TEST_F(SubcommandProgram, HelpOrder) { @@ -306,3 +306,19 @@ TEST_F(SubcommandProgram, HelpOrder) {
306 args = {"-h", "start"}; 306 args = {"-h", "start"};
307 EXPECT_THROW(run(), CLI::CallForHelp); 307 EXPECT_THROW(run(), CLI::CallForHelp);
308 } 308 }
  309 +
  310 +TEST_F(SubcommandProgram, Callbacks) {
  311 +
  312 + start->set_callback([](){
  313 + throw CLI::Success();
  314 + });
  315 +
  316 + run();
  317 +
  318 + app.reset();
  319 +
  320 + args = {"start"};
  321 +
  322 + EXPECT_THROW(run(), CLI::Success);
  323 +
  324 +}