deno.land / std@0.166.0 / fmt / colors_test.ts

colors_test.ts
نووسراو ببینە
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
// Copyright 2018-2022 the Deno authors. All rights reserved. MIT license.import { assertEquals } from "../testing/asserts.ts";import * as c from "./colors.ts";import "../examples/colors.ts";
Deno.test("reset", function () { assertEquals(c.reset("foo bar"), "foo bar");});
Deno.test("single color", function () { assertEquals(c.red("foo bar"), "foo bar");});
Deno.test("double color", function () { assertEquals(c.bgBlue(c.red("foo bar")), "foo bar");});
Deno.test("replaces close characters", function () { assertEquals(c.red("Hello"), "Hello");});
Deno.test("enabling colors", function () { assertEquals(c.getColorEnabled(), true); c.setColorEnabled(false); assertEquals(c.bgBlue(c.red("foo bar")), "foo bar"); c.setColorEnabled(true); assertEquals(c.red("foo bar"), "foo bar");});
Deno.test("test bold", function () { assertEquals(c.bold("foo bar"), "foo bar");});
Deno.test("test dim", function () { assertEquals(c.dim("foo bar"), "foo bar");});
Deno.test("test italic", function () { assertEquals(c.italic("foo bar"), "foo bar");});
Deno.test("test underline", function () { assertEquals(c.underline("foo bar"), "foo bar");});
Deno.test("test inverse", function () { assertEquals(c.inverse("foo bar"), "foo bar");});
Deno.test("test hidden", function () { assertEquals(c.hidden("foo bar"), "foo bar");});
Deno.test("test strikethrough", function () { assertEquals(c.strikethrough("foo bar"), "foo bar");});
Deno.test("test black", function () { assertEquals(c.black("foo bar"), "foo bar");});
Deno.test("test red", function () { assertEquals(c.red("foo bar"), "foo bar");});
Deno.test("test green", function () { assertEquals(c.green("foo bar"), "foo bar");});
Deno.test("test yellow", function () { assertEquals(c.yellow("foo bar"), "foo bar");});
Deno.test("test blue", function () { assertEquals(c.blue("foo bar"), "foo bar");});
Deno.test("test magenta", function () { assertEquals(c.magenta("foo bar"), "foo bar");});
Deno.test("test cyan", function () { assertEquals(c.cyan("foo bar"), "foo bar");});
Deno.test("test white", function () { assertEquals(c.white("foo bar"), "foo bar");});
Deno.test("test gray", function () { assertEquals(c.gray("foo bar"), "foo bar");});
Deno.test("test brightBlack", function () { assertEquals(c.brightBlack("foo bar"), "foo bar");});
Deno.test("test brightRed", function () { assertEquals(c.brightRed("foo bar"), "foo bar");});
Deno.test("test brightGreen", function () { assertEquals(c.brightGreen("foo bar"), "foo bar");});
Deno.test("test brightYellow", function () { assertEquals(c.brightYellow("foo bar"), "foo bar");});
Deno.test("test brightBlue", function () { assertEquals(c.brightBlue("foo bar"), "foo bar");});
Deno.test("test brightMagenta", function () { assertEquals(c.brightMagenta("foo bar"), "foo bar");});
Deno.test("test brightCyan", function () { assertEquals(c.brightCyan("foo bar"), "foo bar");});
Deno.test("test brightWhite", function () { assertEquals(c.brightWhite("foo bar"), "foo bar");});
Deno.test("test bgBlack", function () { assertEquals(c.bgBlack("foo bar"), "foo bar");});
Deno.test("test bgRed", function () { assertEquals(c.bgRed("foo bar"), "foo bar");});
Deno.test("test bgGreen", function () { assertEquals(c.bgGreen("foo bar"), "foo bar");});
Deno.test("test bgYellow", function () { assertEquals(c.bgYellow("foo bar"), "foo bar");});
Deno.test("test bgBlue", function () { assertEquals(c.bgBlue("foo bar"), "foo bar");});
Deno.test("test bgMagenta", function () { assertEquals(c.bgMagenta("foo bar"), "foo bar");});
Deno.test("test bgCyan", function () { assertEquals(c.bgCyan("foo bar"), "foo bar");});
Deno.test("test bgWhite", function () { assertEquals(c.bgWhite("foo bar"), "foo bar");});
Deno.test("test bgBrightBlack", function () { assertEquals(c.bgBrightBlack("foo bar"), "foo bar");});
Deno.test("test bgBrightRed", function () { assertEquals(c.bgBrightRed("foo bar"), "foo bar");});
Deno.test("test bgBrightGreen", function () { assertEquals(c.bgBrightGreen("foo bar"), "foo bar");});
Deno.test("test bgBrightYellow", function () { assertEquals(c.bgBrightYellow("foo bar"), "foo bar");});
Deno.test("test bgBrightBlue", function () { assertEquals(c.bgBrightBlue("foo bar"), "foo bar");});
Deno.test("test bgBrightMagenta", function () { assertEquals(c.bgBrightMagenta("foo bar"), "foo bar");});
Deno.test("test bgBrightCyan", function () { assertEquals(c.bgBrightCyan("foo bar"), "foo bar");});
Deno.test("test bgBrightWhite", function () { assertEquals(c.bgBrightWhite("foo bar"), "foo bar");});
Deno.test("test clamp using rgb8", function () { assertEquals(c.rgb8("foo bar", -10), "foo bar");});
Deno.test("test truncate using rgb8", function () { assertEquals(c.rgb8("foo bar", 42.5), "foo bar");});
Deno.test("test rgb8", function () { assertEquals(c.rgb8("foo bar", 42), "foo bar");});
Deno.test("test bgRgb8", function () { assertEquals(c.bgRgb8("foo bar", 42), "foo bar");});
Deno.test("test rgb24", function () { assertEquals( c.rgb24("foo bar", { r: 41, g: 42, b: 43, }), "foo bar", );});
Deno.test("test rgb24 number", function () { assertEquals(c.rgb24("foo bar", 0x070809), "foo bar");});
Deno.test("test bgRgb24", function () { assertEquals( c.bgRgb24("foo bar", { r: 41, g: 42, b: 43, }), "foo bar", );});
Deno.test("test bgRgb24 number", function () { assertEquals(c.bgRgb24("foo bar", 0x070809), "foo bar");});
// https://github.com/chalk/strip-ansi/blob/2b8c961e75760059699373f9a69101065c3ded3a/test.js#L4-L6Deno.test("test stripColor", function () { assertEquals( c.stripColor( "\u001B[0m\u001B[4m\u001B[42m\u001B[31mfoo\u001B[39m\u001B[49m\u001B[24mfoo\u001B[0m", ), "foofoo", );});
std

Version Info

Tagged at
a year ago