diff options
| author | James Garbutt <43081j@users.noreply.github.com> | 2019-01-15 21:16:52 +0000 |
|---|---|---|
| committer | Ryan Dahl <ry@tinyclouds.org> | 2019-01-15 16:16:52 -0500 |
| commit | 8dd76af9ab7caa6f92b8a89a7adc61504dc7d277 (patch) | |
| tree | 9cccf06c155ee30013054cb9860fc9445c39e948 | |
| parent | 80d30f0bdcaee346b64b09b6a4ed429ada958a89 (diff) | |
colors: add test cases (denoland/deno_std#120)
Original: https://github.com/denoland/deno_std/commit/388bc47ea7569b97c1a729343970c3cdb376c668
| -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"); }); |
