Skip to content

Commit 07937c2

Browse files
committed
update tests
1 parent 043fead commit 07937c2

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

tests/FormatterTest.cpp

+24
Original file line numberDiff line numberDiff line change
@@ -210,12 +210,23 @@ TEST_CASE("Formatter: Footer", "[formatter]") {
210210
CHECK_THAT(help, Contains("is a"));
211211
CHECK_THAT(help, Contains("to Pr e s e r v e SPA C ES"));
212212
CHECK_THAT(help, Contains(footer_string));
213+
214+
help = app.help("", CLI::AppFormatMode::Sub);
215+
CHECK_THAT(help, Contains("is a"));
216+
CHECK_THAT(help, Contains("to Pr e s e r v e SPA C ES"));
217+
CHECK_THAT(help, Contains(footer_string));
218+
213219
app.get_formatter()->enable_footer_formatting(true);
214220
CHECK(app.get_formatter()->is_footer_paragraph_formatting_enabled());
215221
help = app.help("", CLI::AppFormatMode::Normal);
216222
CHECK_THAT(help, !Contains("is a"));
217223
CHECK_THAT(help, !Contains("to Pr e s e r v e SPA C ES"));
218224
CHECK_THAT(help, !Contains(footer_string));
225+
226+
help = app.help("", CLI::AppFormatMode::Sub);
227+
CHECK_THAT(help, !Contains("is a"));
228+
CHECK_THAT(help, !Contains("to Pr e s e r v e SPA C ES"));
229+
CHECK_THAT(help, !Contains(footer_string));
219230
}
220231

221232
TEST_CASE("Formatter: Description", "[formatter]") {
@@ -232,10 +243,23 @@ TEST_CASE("Formatter: Description", "[formatter]") {
232243
CHECK_THAT(help, Contains("is a"));
233244
CHECK_THAT(help, Contains("to Pr e s e r v e SPA C ES"));
234245
CHECK_THAT(help, Contains(desc_string));
246+
247+
help = app.help("", CLI::AppFormatMode::Sub);
248+
CHECK_THAT(help, Contains("is a"));
249+
CHECK_THAT(help, Contains("to Pr e s e r v e SPA C ES"));
250+
CHECK_THAT(help, Contains(desc_string));
251+
235252
app.get_formatter()->enable_description_formatting(true);
236253
CHECK(app.get_formatter()->is_description_paragraph_formatting_enabled());
237254
help = app.help("", CLI::AppFormatMode::Normal);
238255
CHECK_THAT(help, !Contains("is a"));
239256
CHECK_THAT(help, !Contains("to Pr e s e r v e SPA C ES"));
240257
CHECK_THAT(help, !Contains(desc_string));
258+
259+
help = app.help("", CLI::AppFormatMode::Sub);
260+
CHECK_THAT(help, !Contains("is a"));
261+
CHECK_THAT(help, !Contains("to Pr e s e r v e SPA C ES"));
262+
CHECK_THAT(help, !Contains(desc_string));
241263
}
264+
265+

0 commit comments

Comments
 (0)