1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-12-03 17:08:35 -05:00
denoland-deno/colors/test.ts

26 lines
756 B
TypeScript
Raw Normal View History

2019-01-01 22:46:17 -05:00
import { assertEqual, test } from "../testing/mod.ts";
2019-01-10 20:18:21 -05:00
import { color } from "./mod.ts";
import "./example.ts";
2018-12-18 23:30:44 -05:00
test(function singleColor() {
assertEqual(color.red("Hello world"), "Hello world");
});
test(function doubleColor() {
2019-01-15 16:16:52 -05:00
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");
2018-12-18 23:30:44 -05:00
});