Linux cpanel2.daytoncreative.net 2.6.32-754.29.2.el6.x86_64 #1 SMP Tue May 12 17:39:04 UTC 2020 x86_64
Apache/2.4.43 (cPanel) OpenSSL/1.1.1g mod_bwlimited/1.4
Server IP : 70.62.220.67 & Your IP : 216.73.216.193
Domains :
Cant Read [ /etc/named.conf ]
User : michaelgreg
Terminal
Auto Root
Create File
Create Folder
Localroot Suggester
Backdoor Destroyer
Readme
/
var /
log /
perl-5.20.2 /
cpan /
Term-ANSIColor /
t /
Delete
Unzip
Name
Size
Permission
Date
Action
aliases-func.t
2.72
KB
-r--r--r--
2014-12-27 11:49
basic.t
14.8
KB
-r--r--r--
2014-12-27 11:49
basic256.t
4.99
KB
-r--r--r--
2014-12-27 11:49
eval.t
1.23
KB
-r--r--r--
2014-12-27 11:49
stringify.t
1.55
KB
-r--r--r--
2014-12-27 11:49
taint.t
1.29
KB
-r--r--r--
2014-12-27 11:49
Save
Rename
#!/usr/bin/perl # # Test setting color aliases via the function interface. # # Copyright 2012 Russ Allbery <rra@stanford.edu> # # This program is free software; you may redistribute it and/or modify it # under the same terms as Perl itself. use strict; use warnings; use Test::More tests => 23; # Load the module. BEGIN { delete $ENV{ANSI_COLORS_ALIASES}; delete $ENV{ANSI_COLORS_DISABLED}; use_ok('Term::ANSIColor', qw(color colored colorvalid uncolor coloralias)); } # Confirm our test alias doesn't exist. my $output = eval { color('alert') }; ok(!$output, 'alert color not recognized'); like( $@, qr{ \A Invalid [ ] attribute [ ] name [ ] alert [ ] at [ ] }xms, '...with the right error' ); # Basic alias functionality. is(coloralias('alert', 'red'), 'red', 'coloralias works and returns color'); is(color('alert'), color('red'), 'alert now works as a color'); is(colored('test', 'alert'), "\e[31mtest\e[0m", '..and colored works'); ok(colorvalid('alert'), '...and alert is now a valid color'); is(coloralias('alert'), 'red', 'coloralias with one arg returns value'); # The alias can be changed. is(coloralias('alert', 'green'), 'green', 'changing the alias works'); is(coloralias('alert'), 'green', '...and changed the mapping'); is(color('alert'), color('green'), '...and now returns its new value'); # uncolor ignores aliases. is_deeply([uncolor("\e[32m")], ['green'], 'uncolor ignores aliases'); # Asking for the value of an unknown alias returns undef. is(coloralias('warning'), undef, 'coloralias on unknown alias returns undef'); # Invalid alias names. $output = eval { coloralias('foo;bar', 'green') }; ok(!$output, 'invalid alias name rejected'); like( $@, qr{ \A Invalid [ ] alias [ ] name [ ] "foo;bar" [ ] at [ ] }xms, '...with the right error' ); $output = eval { coloralias(q{}, 'green') }; ok(!$output, 'empty alias name rejected'); like( $@, qr{ \A Invalid [ ] alias [ ] name [ ] "" [ ] at [ ] }xms, '...with the right error' ); # Aliasing an existing color. $output = eval { coloralias('red', 'green') }; ok(!$output, 'aliasing an existing color rejected'); like( $@, qr{ \A Cannot [ ] alias [ ] standard [ ] color [ ] "red" [ ] at [ ] }xms, '...with the right error' ); # Aliasing to a color that doesn't exist, or to another alias. $output = eval { coloralias('warning', 'chartreuse') }; ok(!$output, 'aliasing to an unknown color rejected'); like( $@, qr{ \A Invalid [ ] attribute [ ] name [ ] "chartreuse" [ ] at [ ] }xms, '...with the right error' ); $output = eval { coloralias('warning', 'alert') }; ok(!$output, 'aliasing to an alias rejected'); like( $@, qr{ \A Invalid [ ] attribute [ ] name [ ] "alert" [ ] at [ ] }xms, '...with the right error' );