diff --git a/test/unit/detail/format_ctd_test.cpp b/test/unit/detail/format_ctd_test.cpp index 02123018..3832dde7 100644 --- a/test/unit/detail/format_ctd_test.cpp +++ b/test/unit/detail/format_ctd_test.cpp @@ -112,7 +112,7 @@ TEST_F(format_ctd_test, skipped) TEST_F(format_ctd_test, empty_information) { // Create the dummy parser. - auto parser = get_parser( "--export-help", "ctd"); + auto parser = get_parser("--export-help", "ctd"); parser.info.date = "December 01, 1994"; parser.info.version = "1.1.2-rc.1"; parser.info.man_page_title = "default_man_page_title"; @@ -142,7 +142,7 @@ TEST_F(format_ctd_test, empty_information) TEST_F(format_ctd_test, full_information) { // Create the dummy parser. - auto parser = get_parser( "--export-help", "ctd"); + auto parser = get_parser("--export-help", "ctd"); // Fill out the dummy parser with options and flags and sections and subsections. dummy_init(parser); diff --git a/test/unit/detail/format_help_test.cpp b/test/unit/detail/format_help_test.cpp index 2daa6ea3..76b412a5 100644 --- a/test/unit/detail/format_help_test.cpp +++ b/test/unit/detail/format_help_test.cpp @@ -19,22 +19,21 @@ class format_help_test : public sharg::test::test_fixture bool flag_value{false}; std::vector pos_opt_value{}; - static inline std::string basic_options_str = - " Common options\n" - " -h, --help\n" - " Prints the help page.\n" - " -hh, --advanced-help\n" - " Prints the help page including advanced options.\n" - " --version\n" - " Prints the version information.\n" - " --copyright\n" - " Prints the copyright/license information.\n" - " --export-help (std::string)\n" - " Export the help page information. Value must be one of " + static inline std::string basic_options_str = " Common options\n" + " -h, --help\n" + " Prints the help page.\n" + " -hh, --advanced-help\n" + " Prints the help page including advanced options.\n" + " --version\n" + " Prints the version information.\n" + " --copyright\n" + " Prints the copyright/license information.\n" + " --export-help (std::string)\n" + " Export the help page information. Value must be one of " #if SHARG_HAS_TDL - "[html, man,\n ctd, cwl].\n"; + "[html, man,\n ctd, cwl].\n"; #else - "[html, man].\n"; + "[html, man].\n"; #endif static inline std::string basic_version_str = "VERSION\n" diff --git a/test/unit/detail/format_html_test.cpp b/test/unit/detail/format_html_test.cpp index bd71e469..8af74b5f 100644 --- a/test/unit/detail/format_html_test.cpp +++ b/test/unit/detail/format_html_test.cpp @@ -83,15 +83,15 @@ TEST_F(format_html_test, full_information_information) parser.info.author = "author"; parser.info.email = "email"; parser.add_option(option_value, - sharg::config{.short_id = 'i', - .long_id = "int", - .description = "this is a int option.", - .default_message = "A number"}); + sharg::config{.short_id = 'i', + .long_id = "int", + .description = "this is a int option.", + .default_message = "A number"}); parser.add_option(option_value, - sharg::config{.short_id = 'j', - .long_id = "jint", - .description = "this is a required int option.", - .required = true}); + sharg::config{.short_id = 'j', + .long_id = "jint", + .description = "this is a required int option.", + .required = true}); parser.add_flag(flag_value, sharg::config{.short_id = 'f', .long_id = "flag", .description = "this is a flag."}); parser.add_flag(flag_value, sharg::config{.short_id = 'k', .long_id = "kflag", .description = "this is a flag."}); parser.add_positional_option(non_list_pos_opt_value, sharg::config{.description = "this is a positional option."}); diff --git a/test/unit/detail/format_man_test.cpp b/test/unit/detail/format_man_test.cpp index 6bef7b1d..9b786745 100644 --- a/test/unit/detail/format_man_test.cpp +++ b/test/unit/detail/format_man_test.cpp @@ -190,64 +190,63 @@ TEST_F(format_man_test, empty_information) parser.info.man_page_title = "default_man_page_title"; parser.info.short_description = "A short description here."; - std::string expected = - R"(.TH TEST_PARSER 1 "December 01, 1994" "test_parser 01.01.01" "default_man_page_title")" - "\n" - R"(.SH NAME)" - "\n" - R"(test_parser \- A short description here.)" - "\n" - R"(.SH OPTIONS)" - "\n" - R"(.SS Common options)" - "\n" - R"(.TP)" - "\n" - R"(\fB-h\fP, \fB--help\fP)" - "\n" - R"(Prints the help page.)" - "\n" - R"(.TP)" - "\n" - R"(\fB-hh\fP, \fB--advanced-help\fP)" - "\n" - R"(Prints the help page including advanced options.)" - "\n" - R"(.TP)" - "\n" - R"(\fB--version\fP)" - "\n" - R"(Prints the version information.)" - "\n" - R"(.TP)" - "\n" - R"(\fB--copyright\fP)" - "\n" - R"(Prints the copyright/license information.)" - "\n" - R"(.TP)" - "\n" - R"(\fB--export-help\fP (std::string))" - "\n" - R"(Export the help page information. Value must be one of )" + std::string expected = R"(.TH TEST_PARSER 1 "December 01, 1994" "test_parser 01.01.01" "default_man_page_title")" + "\n" + R"(.SH NAME)" + "\n" + R"(test_parser \- A short description here.)" + "\n" + R"(.SH OPTIONS)" + "\n" + R"(.SS Common options)" + "\n" + R"(.TP)" + "\n" + R"(\fB-h\fP, \fB--help\fP)" + "\n" + R"(Prints the help page.)" + "\n" + R"(.TP)" + "\n" + R"(\fB-hh\fP, \fB--advanced-help\fP)" + "\n" + R"(Prints the help page including advanced options.)" + "\n" + R"(.TP)" + "\n" + R"(\fB--version\fP)" + "\n" + R"(Prints the version information.)" + "\n" + R"(.TP)" + "\n" + R"(\fB--copyright\fP)" + "\n" + R"(Prints the copyright/license information.)" + "\n" + R"(.TP)" + "\n" + R"(\fB--export-help\fP (std::string))" + "\n" + R"(Export the help page information. Value must be one of )" #if SHARG_HAS_TDL - "[html, man, ctd, cwl]." + "[html, man, ctd, cwl]." #else - "[html, man]." + "[html, man]." #endif - "\n" - R"(.SH VERSION)" - "\n" - R"(\fBLast update: \fRDecember 01, 1994)" - "\n" - R"(.br)" - "\n" - R"(\fBtest_parser version: \fR01.01.01)" - "\n" - R"(.br)" - "\n" - R"(\fBSharg version: \fR)" - + version_str + "\n"; + "\n" + R"(.SH VERSION)" + "\n" + R"(\fBLast update: \fRDecember 01, 1994)" + "\n" + R"(.br)" + "\n" + R"(\fBtest_parser version: \fR01.01.01)" + "\n" + R"(.br)" + "\n" + R"(\fBSharg version: \fR)" + + version_str + "\n"; EXPECT_EQ(get_parse_cout_on_exit(parser), expected); }