Checking only for "Usage:" but as a constant; No ANSI codes!

This commit is contained in:
Philip Helger 2025-08-27 17:08:19 +02:00
parent 7a7712188d
commit a8a3fd100c
2 changed files with 5 additions and 11 deletions

View file

@ -76,18 +76,12 @@ public class CommandlineApplicationTest {
final String[] args = { "-?" };
CommandLineApplication.mainProgram(args);
assertThat(CommandLine.getErrorOutput()).isEmpty();
log.warn("Philip1");
checkForHelp(CommandLine.getOutputLines());
log.warn("Philip2");
}
private static void checkForHelp(final List<String> outputLines) {
assertThat(outputLines.size()).isPositive();
log.warn("!!!!");
for (final String s : outputLines)
log.warn(s);
log.warn("!!!");
assertThat(outputLines.stream().filter(l -> l.startsWith("Usage: KoSIT Validator"))).hasSize(1);
assertThat(outputLines.stream().filter(l -> l.startsWith(CommandLineOptions.SYNOSIS_HEADING))).hasSize(1);
}
@Test