Skip to content

Commit

Permalink
style: pre-commit.ci fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
pre-commit-ci[bot] committed Sep 27, 2024
1 parent 8dd8d00 commit a814267
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 12 deletions.
4 changes: 2 additions & 2 deletions examples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ set_property(
"Working on count: 2, direct count: 2, opt count: 2" "Some value: 1.2")
# test shows that the help prints out for unnamed subcommands
add_test(NAME subcom_partitioned_help COMMAND subcom_partitioned --help)
set_property(TEST subcom_partitioned_help PROPERTY PASS_REGULAR_EXPRESSION
"-f,[ \\t]*--file TEXT REQUIRED" "-d,--double FLOAT")
set_property(TEST subcom_partitioned_help
PROPERTY PASS_REGULAR_EXPRESSION "-f,[ \\t]*--file TEXT REQUIRED" "-d,--double FLOAT")

####################################################
add_cli_exe(config_app config_app.cpp)
Expand Down
2 changes: 0 additions & 2 deletions tests/FormatterTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ TEST_CASE("Formatter: OptCustomize", "[formatter]") {
CHECK_THAT(help, Contains("Something"));
CHECK_THAT(help, Contains("--opt INT"));
CHECK_THAT(help, Contains("-h, --help Print"));

}

TEST_CASE("Formatter: OptCustomizeSimple", "[formatter]") {
Expand Down Expand Up @@ -145,7 +144,6 @@ TEST_CASE("Formatter: AppCustomizeSimple", "[formatter]") {
CHECK_THAT(help, Contains("\nSUBCOMMANDS:\n"));
CHECK_THAT(help, Contains(" subcom2 This\n"));
CHECK_THAT(help, Contains(" subcom2 This\n"));

}

TEST_CASE("Formatter: AllSub", "[formatter]") {
Expand Down
15 changes: 7 additions & 8 deletions tests/HelpTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -741,13 +741,13 @@ TEST_CASE("THelp: NextLineShouldBeAlignmentInMultilineDescription", "[help]") {

const std::string help = app.help();
const auto width = app.get_formatter()->get_column_width();
auto first_loc=help.find("first");
auto first_new_line=help.find_last_of('\n',first_loc);
auto second_loc=help.find("second");
auto second_new_line=help.find_last_of('\n',second_loc);
CHECK(first_loc-first_new_line-1==width);
CHECK(second_loc-second_new_line-1==width);
CHECK(second_new_line>first_loc);
auto first_loc = help.find("first");
auto first_new_line = help.find_last_of('\n', first_loc);
auto second_loc = help.find("second");
auto second_new_line = help.find_last_of('\n', second_loc);
CHECK(first_loc - first_new_line - 1 == width);
CHECK(second_loc - second_new_line - 1 == width);
CHECK(second_new_line > first_loc);
}

TEST_CASE("THelp: NiceName", "[help]") {
Expand Down Expand Up @@ -858,7 +858,6 @@ TEST_CASE_METHOD(CapturedHelp, "CallForAllHelpOutput", "[help]") {
CHECK_THAT(out.str(), Contains("SUBCOMMANDS:"));
CHECK_THAT(out.str(), Contains("--help-all"));
CHECK_THAT(out.str(), Contains("My Test Program"));

}
TEST_CASE_METHOD(CapturedHelp, "NewFormattedHelp", "[help]") {
app.formatter_fn([](const CLI::App *, std::string, CLI::AppFormatMode) { return "New Help"; });
Expand Down

0 comments on commit a814267

Please sign in to comment.