1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-30 16:40:57 -05:00

colors: add test cases (#120)

This commit is contained in:
James Garbutt 2019-01-15 21:16:52 +00:00 committed by Ryan Dahl
parent 6a41189a98
commit 388bc47ea7

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