1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2025-01-14 10:01:51 -05:00

colors: add test cases (denoland/deno_std#120)

Original: 388bc47ea7
This commit is contained in:
James Garbutt 2019-01-15 21:16:52 +00:00 committed by Ryan Dahl
parent 80d30f0bdc
commit 8dd76af9ab

View file

@ -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");
});