From 8dd76af9ab7caa6f92b8a89a7adc61504dc7d277 Mon Sep 17 00:00:00 2001 From: James Garbutt <43081j@users.noreply.github.com> Date: Tue, 15 Jan 2019 21:16:52 +0000 Subject: [PATCH] colors: add test cases (denoland/deno_std#120) Original: https://github.com/denoland/deno_std/commit/388bc47ea7569b97c1a729343970c3cdb376c668 --- colors/test.ts | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/colors/test.ts b/colors/test.ts index 1acc300721..266868090f 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"), "Hello world"); + assertEqual(color.red.bgBlue("Hello world"), + "Hello world"); +}); + +test(function newLinesContinueColors() { + assertEqual(color.red("Hello\nworld"), + "Hello\nworld"); + assertEqual(color.red("Hello\r\nworld"), + "Hello\r\nworld"); + assertEqual(color.red("Hello\n\nworld"), + "Hello\n\nworld"); +}); + +test(function replacesCloseCharacters() { + assertEqual(color.red("Hello"), "Hello"); });