From 916c9e91cfc0dde47289b2de8f4efd17623149c7 Mon Sep 17 00:00:00 2001 From: Michael L Heuer Date: Tue, 15 Feb 2022 13:08:01 -0600 Subject: [PATCH] fix test assertions --- .../picocli/groovy/PicocliBaseScript2Test.groovy | 2 +- src/test/java/picocli/AutoCompleteTest.java | 2 +- src/test/java/picocli/Demo.java | 4 ++-- src/test/java/picocli/HelpSubCommandTest.java | 12 ++++++------ src/test/java/picocli/HelpTest.java | 6 +++--- src/test/java/picocli/InterpolatedModelTest.java | 4 ++-- 6 files changed, 15 insertions(+), 15 deletions(-) diff --git a/picocli-groovy/src/test/groovy/picocli/groovy/PicocliBaseScript2Test.groovy b/picocli-groovy/src/test/groovy/picocli/groovy/PicocliBaseScript2Test.groovy index a10d509ff..bb6d38b4f 100644 --- a/picocli-groovy/src/test/groovy/picocli/groovy/PicocliBaseScript2Test.groovy +++ b/picocli-groovy/src/test/groovy/picocli/groovy/PicocliBaseScript2Test.groovy @@ -446,7 +446,7 @@ println "done" " -h, --help Show this help message and exit.%n" + " -V, --version Print version information and exit.%n" + "Commands:%n" + - " help Displays help information about the specified command%n" + + " help Display help information about the specified command.%n" + " commit Record changes to the repository" assertEquals(String.format(expected), baos.toString().trim()) assertEquals(null, result) diff --git a/src/test/java/picocli/AutoCompleteTest.java b/src/test/java/picocli/AutoCompleteTest.java index b7ccf3d93..50154e2e4 100644 --- a/src/test/java/picocli/AutoCompleteTest.java +++ b/src/test/java/picocli/AutoCompleteTest.java @@ -1614,7 +1614,7 @@ public void run() { } " --apples=%n" + " --bbb=%n" + "Commands:%n" + - " help Displays help information about the specified command%n"); + " help Display help information about the specified command.%n"); assertEquals(expectedUsage, cmd.getUsageMessage(CommandLine.Help.Ansi.OFF)); StringWriter sw = new StringWriter(); diff --git a/src/test/java/picocli/Demo.java b/src/test/java/picocli/Demo.java index 93ab31cb9..475d233f7 100644 --- a/src/test/java/picocli/Demo.java +++ b/src/test/java/picocli/Demo.java @@ -486,7 +486,7 @@ public void testUsageMainCommand() { "Commands:%n" + "%n" + "The most commonly used git commands are:%n" + - " help Displays help information about the specified command%n" + + " help Display help information about the specified command.%n" + " status Show the working tree status.%n" + " commit Record changes to the repository.%n" + " add Add file contents to the index.%n" + @@ -510,7 +510,7 @@ public void testUsageMainCommand() { "Commands:%n" + "%n" + "The most commonly used git commands are:%n" + - " \u001B[1mhelp\u001B[21m\u001B[0m Displays help information about the specified command%n" + + " \u001B[1mhelp\u001B[21m\u001B[0m Display help information about the specified command.%n" + " \u001B[1mstatus\u001B[21m\u001B[0m Show the working tree status.%n" + " \u001B[1mcommit\u001B[21m\u001B[0m Record changes to the repository.%n" + " \u001B[1madd\u001B[21m\u001B[0m Add file contents to the index.%n" + diff --git a/src/test/java/picocli/HelpSubCommandTest.java b/src/test/java/picocli/HelpSubCommandTest.java index 667887b4e..dfec1f592 100644 --- a/src/test/java/picocli/HelpSubCommandTest.java +++ b/src/test/java/picocli/HelpSubCommandTest.java @@ -306,7 +306,7 @@ class App implements Runnable{ public void run(){}} " -V, --version Print version information and exit.%n" + "Commands:%n" + " sub This is a subcommand%n" + - " help Displays help information about the specified command%n"); + " help Display help information about the specified command.%n"); assertEquals(expected, sw.toString()); } @@ -328,7 +328,7 @@ class App implements Runnable{ public void run(){}} " -V, --version Print version information and exit.%n" + "Commands:%n" + " sub This is a subcommand%n" + - " help Displays help information about the specified command%n"); + " help Display help information about the specified command.%n"); assertEquals(expected, sw.toString()); } @@ -344,7 +344,7 @@ class App implements Runnable{ public void run(){}} .execute("help", "-h"); String expected = String.format("" + - "Displays help information about the specified command%n" + + "Display help information about the specified command.%n" + "%n" + "Usage:
help [-h] [COMMAND]%n" + "%n" + @@ -377,7 +377,7 @@ class App implements Runnable{ public void run(){}} " -V, --version Print version information and exit.%n" + "Commands:%n" + " sub This is a subcommand%n" + - " help Displays help information about the specified command%n"); + " help Display help information about the specified command.%n"); assertEquals(expected, sw.toString()); sw = new StringWriter(); @@ -408,7 +408,7 @@ public void testHelpSubcommandRunPrintsParentUsageIfParentSet() { "Usage: parent [COMMAND]%n" + "the parent command%n" + "Commands:%n" + - " parent Displays help information about the specified command%n"); + " parent Display help information about the specified command.%n"); assertEquals(expected, this.systemOutRule.getLog()); } @@ -427,7 +427,7 @@ public void testHelpSubcommand2RunPrintsParentUsageIfParentSet() { "Usage: parent [COMMAND]%n" + "the parent command%n" + "Commands:%n" + - " parent Displays help information about the specified command%n"); + " parent Display help information about the specified command.%n"); assertEquals(expected, this.systemOutRule.getLog()); } diff --git a/src/test/java/picocli/HelpTest.java b/src/test/java/picocli/HelpTest.java index 9173121d1..39c70438d 100644 --- a/src/test/java/picocli/HelpTest.java +++ b/src/test/java/picocli/HelpTest.java @@ -3295,7 +3295,7 @@ public void testAutoHelpMixinUsageHelpSubcommandOnAppWithoutSubcommands() { " -h, --help Show this help message and exit.%n" + " -V, --version Print version information and exit.%n" + "Commands:%n" + - " help Displays help information about the specified command%n"); + " help Display help information about the specified command.%n"); assertEquals(expected, baos.toString()); } @@ -3315,7 +3315,7 @@ class App implements Runnable{ public void run(){}} " -h, --help Show this help message and exit.%n" + " -V, --version Print version information and exit.%n" + "Commands:%n" + - " help Displays help information about the specified command%n"); + " help Display help information about the specified command.%n"); assertEquals(expected, sw.toString()); } @@ -5118,7 +5118,7 @@ class MyTool { String expected = String.format("" + "Usage:
[COMMAND]%n" + "Commands:%n" + - " help Displays help information about the specified command%n"); + " help Display help information about the specified command.%n"); String actual = new CommandLine(new MyTool()).getUsageMessage(); assertEquals(expected, actual); } diff --git a/src/test/java/picocli/InterpolatedModelTest.java b/src/test/java/picocli/InterpolatedModelTest.java index 3c974843a..a15d46367 100644 --- a/src/test/java/picocli/InterpolatedModelTest.java +++ b/src/test/java/picocli/InterpolatedModelTest.java @@ -72,7 +72,7 @@ class App { "OPTION HEADING%n" + " -x+ option description%n" + "SUBCOMMANDS HEADING%n" + - " help Displays help information about the specified command%n" + + " help Display help information about the specified command.%n" + "FOOTER HEADING%n" + "FOOTER 1%n" + "and FOOTER 2%n"); @@ -138,7 +138,7 @@ class App { "OPTION HEADING%n" + " -x+ option description%n" + "SUBCOMMANDS HEADING%n" + - " help Displays help information about the specified command%n" + + " help Display help information about the specified command.%n" + "FOOTER HEADING%n" + "FOOTER 1%n" + "and FOOTER 2%n");