-
Notifications
You must be signed in to change notification settings - Fork 140
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
25 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
src/test/java/org/fusesource/jansi/io/AnsiOutputStreamTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package org.fusesource.jansi.io; | ||
|
||
import org.fusesource.jansi.AnsiColors; | ||
import org.fusesource.jansi.AnsiMode; | ||
import org.fusesource.jansi.AnsiType; | ||
import org.junit.jupiter.api.Test; | ||
|
||
import java.io.ByteArrayOutputStream; | ||
import java.io.IOException; | ||
import java.nio.charset.Charset; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertEquals; | ||
|
||
class AnsiOutputStreamTest { | ||
@Test | ||
void canHandleSgrsWithMultipleOptions() throws IOException { | ||
final ByteArrayOutputStream baos = new ByteArrayOutputStream(); | ||
final AnsiOutputStream ansiOutput = new AnsiOutputStream(baos, AnsiMode.Strip, null, AnsiType.Emulation, AnsiColors.TrueColor, Charset.forName("UTF-8"), null, null, false); | ||
ansiOutput.write("\u001B[33mbanana_1 |\u001B[0m 19:59:14.353\u001B[0;38m [debug] Lager installed handler {lager_file_backend,\"banana.log\"} into lager_event\u001B[0m\n".getBytes()); | ||
assertEquals("banana_1 | 19:59:14.353 [debug] Lager installed handler {lager_file_backend,\"banana.log\"} into lager_event\n", baos.toString()); | ||
} | ||
} |