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:
parent
6a41189a98
commit
388bc47ea7
1 changed files with 15 additions and 1 deletions
|
@ -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");
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue