mirror of
https://github.com/openjdk/jdk.git
synced 2026-03-12 08:53:12 +00:00
8131913: jdk/internal/jline/console/StripAnsiTest.java can't run in the background
Avoid using a real terminal in tests. Reviewed-by: rfield
This commit is contained in:
parent
b69f398c06
commit
4b4f61a64a
@ -23,14 +23,16 @@
|
||||
|
||||
/**
|
||||
* @test
|
||||
* @bug 8080679
|
||||
* @modules jdk.internal.le/jdk.internal.jline.console
|
||||
* @bug 8080679 8131913
|
||||
* @modules jdk.internal.le/jdk.internal.jline
|
||||
* jdk.internal.le/jdk.internal.jline.console
|
||||
* @summary Verify ConsoleReader.stripAnsi strips escape sequences from its input correctly.
|
||||
*/
|
||||
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.lang.reflect.Method;
|
||||
import jdk.internal.jline.UnsupportedTerminal;
|
||||
import jdk.internal.jline.console.ConsoleReader;
|
||||
|
||||
public class StripAnsiTest {
|
||||
@ -41,7 +43,7 @@ public class StripAnsiTest {
|
||||
void run() throws Exception {
|
||||
ByteArrayInputStream in = new ByteArrayInputStream(new byte[0]);
|
||||
ByteArrayOutputStream out = new ByteArrayOutputStream();
|
||||
ConsoleReader reader = new ConsoleReader(in, out);
|
||||
ConsoleReader reader = new ConsoleReader(in, out, new UnsupportedTerminal());
|
||||
|
||||
String withAnsi = "0\033[s1\033[2J2\033[37;4m3";
|
||||
String expected = "0123";
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user