summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Garbutt <43081j@users.noreply.github.com>2019-01-15 21:16:52 +0000
committerRyan Dahl <ry@tinyclouds.org>2019-01-15 16:16:52 -0500
commit8dd76af9ab7caa6f92b8a89a7adc61504dc7d277 (patch)
tree9cccf06c155ee30013054cb9860fc9445c39e948
parent80d30f0bdcaee346b64b09b6a4ed429ada958a89 (diff)
colors: add test cases (denoland/deno_std#120)
Original: https://github.com/denoland/deno_std/commit/388bc47ea7569b97c1a729343970c3cdb376c668
-rw-r--r--colors/test.ts16
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"), "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");
});