summaryrefslogtreecommitdiff
path: root/std/fmt/colors_test.ts
diff options
context:
space:
mode:
authorOliver Lenehan <sunsetkookaburra+git@outlook.com.au>2020-05-09 20:29:44 +1000
committerGitHub <noreply@github.com>2020-05-09 06:29:44 -0400
commit7d3728e3f4b8c9764518bcbe7e4a49cd18fb1f90 (patch)
treeb1cd1f334e14ef188c0c96a4dcc699b7b09fc09a /std/fmt/colors_test.ts
parent9790399bcea36091da85799c4ed86ead6c9af92a (diff)
feat(std/fmt): 8bit and 24bit ANSI colors (#5168)
Diffstat (limited to 'std/fmt/colors_test.ts')
-rw-r--r--std/fmt/colors_test.ts38
1 files changed, 38 insertions, 0 deletions
diff --git a/std/fmt/colors_test.ts b/std/fmt/colors_test.ts
index 6c80b4109..cfa189d30 100644
--- a/std/fmt/colors_test.ts
+++ b/std/fmt/colors_test.ts
@@ -118,3 +118,41 @@ Deno.test("testBgCyan", function (): void {
Deno.test("testBgWhite", function (): void {
assertEquals(c.bgWhite("foo bar"), "foo bar");
});
+
+Deno.test("testClampUsingRgb8", function (): void {
+ assertEquals(c.rgb8("foo bar", -10), "foo bar");
+});
+
+Deno.test("testTruncateUsingRgb8", function (): void {
+ assertEquals(c.rgb8("foo bar", 42.5), "foo bar");
+});
+
+Deno.test("testRgb8", function (): void {
+ assertEquals(c.rgb8("foo bar", 42), "foo bar");
+});
+
+Deno.test("test_bgRgb8", function (): void {
+ assertEquals(c.bgRgb8("foo bar", 42), "foo bar");
+});
+
+Deno.test("test_rgb24", function (): void {
+ assertEquals(
+ c.rgb24("foo bar", {
+ r: 41,
+ g: 42,
+ b: 43,
+ }),
+ "foo bar"
+ );
+});
+
+Deno.test("test_bgRgb24", function (): void {
+ assertEquals(
+ c.bgRgb24("foo bar", {
+ r: 41,
+ g: 42,
+ b: 43,
+ }),
+ "foo bar"
+ );
+});