diff options
| -rw-r--r-- | colors/test.ts | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/colors/test.ts b/colors/test.ts index 1acc30072..266868090 100644 --- a/colors/test.ts +++ b/colors/test.ts @@ -7,5 +7,19 @@ test(function singleColor() { }); test(function doubleColor() { - assertEqual(color.red.bgBlue("Hello world"), "[44m[31mHello world[39m[49m"); + assertEqual(color.red.bgBlue("Hello world"), + "[44m[31mHello world[39m[49m"); +}); + +test(function newLinesContinueColors() { + assertEqual(color.red("Hello\nworld"), + "[31mHello[39m\n[31mworld[39m"); + assertEqual(color.red("Hello\r\nworld"), + "[31mHello[39m\r\n[31mworld[39m"); + assertEqual(color.red("Hello\n\nworld"), + "[31mHello[39m\n[31m[39m\n[31mworld[39m"); +}); + +test(function replacesCloseCharacters() { + assertEqual(color.red("Hel[39mlo"), "[31mHel[31mlo[39m"); }); |
