Skip to content

Commit 0fcbe04

Browse files
committed
[TEST] ensure test compares usage help message with ANSI escape codes OFF
1 parent 4c79196 commit 0fcbe04

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

picocli-codegen-tests-java9plus/src/test/java/picocli/Issue1380Test.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ public class Issue1380Test {
5656
public void testingWithExclusiveTrue() {
5757
ByteArrayOutputStream tempOut = new ByteArrayOutputStream();
5858
PrintStream printStream = new PrintStream(tempOut);
59-
new CommandLine(new TestingClassExclusiveTrue()).usage(printStream);
59+
new CommandLine(new TestingClassExclusiveTrue()).usage(printStream, CommandLine.Help.Ansi.OFF);
6060

6161
String returnedText = tempOut.toString();
6262
String expectedText = String.format(
@@ -75,7 +75,7 @@ public void testingWithExclusiveTrue() {
7575
public void testingWithExclusiveFalse() {
7676
ByteArrayOutputStream tempOut = new ByteArrayOutputStream();
7777
PrintStream printStream = new PrintStream(tempOut);
78-
new CommandLine(new TestingClassExclusiveFalse()).usage(printStream);
78+
new CommandLine(new TestingClassExclusiveFalse()).usage(printStream, CommandLine.Help.Ansi.OFF);
7979

8080
String returnedText = tempOut.toString();
8181
String expectedText = String.format(

src/test/java/picocli/Issue1125_1538_OptionNameOrSubcommandAsOptionValue.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
import org.junit.Rule;
99
import org.junit.Test;
10+
import org.junit.contrib.java.lang.system.ProvideSystemProperty;
1011
import org.junit.contrib.java.lang.system.SystemErrRule;
1112
import picocli.CommandLine.Command;
1213
import picocli.CommandLine.Help.Ansi;
@@ -22,6 +23,8 @@ public class Issue1125_1538_OptionNameOrSubcommandAsOptionValue {
2223

2324
@Rule
2425
public SystemErrRule systemErrRule = new SystemErrRule().enableLog().muteForSuccessfulTests();
26+
@Rule
27+
public final ProvideSystemProperty ansiOFF = new ProvideSystemProperty("picocli.ansi", "false");
2528

2629
@Command(name = "mycommand")
2730
static class MyCommand implements Callable<Integer> {

0 commit comments

Comments
 (0)