Skip to content

Commit 5430817

Browse files
committed
Adding group ordering test
1 parent fc8eef3 commit 5430817

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

tests/HelpTest.cpp

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -516,3 +516,19 @@ TEST(THelp, RequiredPrintout) {
516516

517517
EXPECT_THAT(app.help(), HasSubstr("(REQUIRED)"));
518518
}
519+
520+
TEST(THelp, GroupOrder) {
521+
CLI::App app;
522+
523+
app.add_flag("--one")->group("zee");
524+
app.add_flag("--two")->group("aee");
525+
526+
std::string help = app.help();
527+
528+
auto zee_loc = help.find("zee");
529+
auto aee_loc = help.find("aee");
530+
531+
EXPECT_NE(zee_loc, std::string::npos);
532+
EXPECT_NE(aee_loc, std::string::npos);
533+
EXPECT_LT(zee_loc, aee_loc);
534+
}

0 commit comments

Comments
 (0)