910111213141516
public class TestVT100Writer extends TestCase { public void testRedFg() { ByteArrayOutputStream bout = new ByteArrayOutputStream(); new VT100Writer(new PrintStream(bout)).fg(Color.RED); assertEquals(ESC + "31m", new String(bout.toByteArray())); }
1617181920212223
} public void testBold() { ByteArrayOutputStream bout = new ByteArrayOutputStream(); new VT100Writer(new PrintStream(bout)).mod(CharacterModifier.BOLD); assertEquals(ESC + "1m", new String(bout.toByteArray())); }
2324252627282930
} public void testRedFgBold() { ByteArrayOutputStream bout = new ByteArrayOutputStream(); new VT100Writer(new PrintStream(bout)).fg(Color.RED, CharacterModifier.BOLD); assertEquals(ESC + "1;31m", new String(bout.toByteArray())); }