@@ -217,6 +217,14 @@ mod tests {
217
217
test ! ( "255 -1" => Ansi256Color ( 255 ) . on_default( ) ) ;
218
218
test ! ( "#000000" => RgbColor ( 0 , 0 , 0 ) . on_default( ) ) ;
219
219
test ! ( "#204060" => RgbColor ( 0x20 , 0x40 , 0x60 ) . on_default( ) ) ;
220
+ test ! ( "#1a2b3c" => RgbColor ( 0x1a , 0x2b , 0x3c ) . on_default( ) ) ;
221
+ test ! ( "#000" => RgbColor ( 0 , 0 , 0 ) . on_default( ) ) ;
222
+ test ! ( "#cba" => RgbColor ( 0xc , 0xb , 0xa ) . on_default( ) ) ;
223
+ test ! ( "#cba " => RgbColor ( 0xc , 0xb , 0xa ) . on_default( ) ) ;
224
+ test ! ( "#987 #135" => RgbColor ( 9 , 8 , 7 ) . on( RgbColor ( 1 , 3 , 5 ) ) ) ;
225
+ test ! ( "#987 #135 " => RgbColor ( 9 , 8 , 7 ) . on( RgbColor ( 1 , 3 , 5 ) ) ) ;
226
+ test ! ( "#123 #abcdef" => RgbColor ( 1 , 2 , 3 ) . on( RgbColor ( 0xab , 0xcd , 0xef ) ) ) ;
227
+ test ! ( "#654321 #a9b" => RgbColor ( 0x65 , 0x43 , 0x21 ) . on( RgbColor ( 0xa , 0x9 , 0xb ) ) ) ;
220
228
221
229
test ! ( "bold cyan white" => Cyan . on( White ) . bold( ) ) ;
222
230
test ! ( "bold cyan nobold white" => Cyan . on( White ) ) ;
@@ -226,6 +234,8 @@ mod tests {
226
234
test ! ( "italic cyan white" => Cyan . on( White ) . italic( ) ) ;
227
235
test ! ( "strike cyan white" => Cyan . on( White ) . strikethrough( ) ) ;
228
236
test ! ( "blink #050505 white" => RgbColor ( 5 , 5 , 5 ) . on( White ) . blink( ) ) ;
237
+ test ! ( "bold #987 green" => RgbColor ( 9 , 8 , 7 ) . on( Green ) . bold( ) ) ;
238
+ test ! ( "strike #147 #cba" => RgbColor ( 1 , 4 , 7 ) . on( RgbColor ( 0xc , 0xb , 0xa ) ) . strikethrough( ) ) ;
229
239
}
230
240
231
241
#[ test]
@@ -249,6 +259,9 @@ mod tests {
249
259
test ! ( "red blue -1" => ExtraColor "-1" ) ;
250
260
test ! ( "yellow green #abcdef" => ExtraColor "#abcdef" ) ;
251
261
test ! ( "#123456 #654321 #abcdef" => ExtraColor "#abcdef" ) ;
262
+ test ! ( "#123 #654 #abc" => ExtraColor "#abc" ) ;
263
+ test ! ( "#123 #654 #abcdef" => ExtraColor "#abcdef" ) ;
264
+ test ! ( "#123456 #654321 #abc" => ExtraColor "#abc" ) ;
252
265
test ! ( "bold red blue green" => ExtraColor "green" ) ;
253
266
test ! ( "red bold blue green" => ExtraColor "green" ) ;
254
267
test ! ( "red blue bold green" => ExtraColor "green" ) ;
@@ -270,8 +283,14 @@ mod tests {
270
283
test ! ( "no-green" => UnknownWord "no-green" ) ;
271
284
test ! ( "no-#123456" => UnknownWord "no-#123456" ) ;
272
285
test ! ( "#" => UnknownWord "#" ) ;
286
+ test ! ( "#1" => UnknownWord "#1" ) ;
287
+ test ! ( "#12" => UnknownWord "#12" ) ;
288
+ test ! ( "#1234" => UnknownWord "#1234" ) ;
273
289
test ! ( "#12345" => UnknownWord "#12345" ) ;
274
290
test ! ( "#1234567" => UnknownWord "#1234567" ) ;
291
+ test ! ( "#12345678" => UnknownWord "#12345678" ) ;
292
+ test ! ( "#123456789" => UnknownWord "#123456789" ) ;
293
+ test ! ( "#123456789abc" => UnknownWord "#123456789abc" ) ;
275
294
test ! ( "#bcdefg" => UnknownWord "#bcdefg" ) ;
276
295
test ! ( "#blue" => UnknownWord "#blue" ) ;
277
296
test ! ( "blue#123456" => UnknownWord "blue#123456" ) ;
0 commit comments