5 unshift @INC, '../lib';
8 # Test suite for the Term::ANSIColor Perl module. Before `make install' is
9 # performed this script should be runnable with `make test'. After `make
10 # install' it should work as `perl test.pl'.
12 ############################################################################
13 # Ensure module can be loaded
14 ############################################################################
16 BEGIN { $| = 1; print "1..7\n" }
17 END { print "not ok 1\n" unless $loaded }
18 use Term::ANSIColor qw(:constants color colored);
23 ############################################################################
25 ############################################################################
27 # Test simple color attributes.
28 if (color ('blue on_green', 'bold') eq "\e[34;42;1m") {
35 if (colored ("testing", 'blue', 'bold') eq "\e[34;1mtesting\e[0m") {
42 if (BLUE BOLD "testing" eq "\e[34m\e[1mtesting") {
49 $Term::ANSIColor::AUTORESET = 1;
50 if (BLUE BOLD "testing" eq "\e[34m\e[1mtesting\e[0m\e[0m") {
57 $Term::ANSIColor::EACHLINE = "\n";
58 if (colored ("test\n\ntest", 'bold')
59 eq "\e[1mtest\e[0m\n\n\e[1mtest\e[0m") {
62 print colored ("test\n\ntest", 'bold'), "\n";
66 # Test EACHLINE with multiple trailing delimiters.
67 $Term::ANSIColor::EACHLINE = "\r\n";
68 if (colored ("test\ntest\r\r\n\r\n", 'bold')
69 eq "\e[1mtest\ntest\r\e[0m\r\n\r\n") {