mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-08-18 20:38:02 +08:00
add ansi
This commit is contained in:
@@ -75,4 +75,9 @@ public class ConsoleTest {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void printColorTest(){
|
||||
System.out.print("\33[30;1m A \u001b[31;2m B \u001b[32;1m C \u001b[33;1m D \u001b[0m");
|
||||
}
|
||||
|
||||
}
|
||||
|
13
hutool-core/src/test/java/cn/hutool/core/lang/ansi/AnsiEncoderTest.java
Executable file
13
hutool-core/src/test/java/cn/hutool/core/lang/ansi/AnsiEncoderTest.java
Executable file
@@ -0,0 +1,13 @@
|
||||
package cn.hutool.core.lang.ansi;
|
||||
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
|
||||
public class AnsiEncoderTest {
|
||||
|
||||
@Test
|
||||
public void encodeTest(){
|
||||
final String encode = AnsiEncoder.encode(AnsiColor.GREEN, "Hutool test");
|
||||
Assert.assertEquals("\u001B[32mHutool test\u001B[0;39m", encode);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user