1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-23 15:16:54 -05:00
denoland-deno/colors/test.ts
2019-01-15 16:16:52 -05:00

25 lines
756 B
TypeScript
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import { assertEqual, test } from "../testing/mod.ts";
import { color } from "./mod.ts";
import "./example.ts";
test(function singleColor() {
assertEqual(color.red("Hello world"), "Hello world");
});
test(function doubleColor() {
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");
});