File tree Expand file tree Collapse file tree 2 files changed +30
-0
lines changed
main/java/org/fusesource/jansi
test/java/org/fusesource/jansi Expand file tree Collapse file tree 2 files changed +30
-0
lines changed Original file line number Diff line number Diff line change @@ -249,6 +249,26 @@ public Ansi bgBright(Color color) {
249249 return this ;
250250 }
251251
252+ @ Override
253+ public Ansi fg (int color ) {
254+ return this ;
255+ }
256+
257+ @ Override
258+ public Ansi fgRgb (int r , int g , int b ) {
259+ return this ;
260+ }
261+
262+ @ Override
263+ public Ansi bg (int color ) {
264+ return this ;
265+ }
266+
267+ @ Override
268+ public Ansi bgRgb (int r , int g , int b ) {
269+ return this ;
270+ }
271+
252272 @ Override
253273 public Ansi a (Attribute attribute ) {
254274 return this ;
Original file line number Diff line number Diff line change @@ -139,6 +139,16 @@ public void testCursorUpLine(int n, String expected) {
139139 assertAnsi (expected , new Ansi ().cursorUpLine (n ));
140140 }
141141
142+ @ Test
143+ public void testColorDisabled () {
144+ Ansi .setEnabled (false );
145+ try {
146+ assertEquals ("test" , Ansi .ansi ().fg (32 ).a ("t" ).fgRgb (0 ).a ("e" ).bg (24 ).a ("s" ).bgRgb (100 ).a ("t" ).toString ());
147+ } finally {
148+ Ansi .setEnabled (true );
149+ }
150+ }
151+
142152 private static void assertAnsi (String expected , Ansi actual ) {
143153 assertEquals (expected .replace ("ESC" , "\033 " ), actual .toString ());
144154 }
You can’t perform that action at this time.
0 commit comments