X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Flib%2Fansicolor.t;h=f38e905cdd8c1c12257babae5c60cab753d57411;hb=22d4bb9ccb8701e68f9243547d7e3a3c55f70908;hp=3e16dce653a92053e778a838d644631f95a82a3c;hpb=4b19af017623bfa3bb72bb164598a517f586e0d3;p=p5sagit%2Fp5-mst-13.2.git diff --git a/t/lib/ansicolor.t b/t/lib/ansicolor.t index 3e16dce..f38e905 100755 --- a/t/lib/ansicolor.t +++ b/t/lib/ansicolor.t @@ -1,8 +1,6 @@ -#!./perl - BEGIN { chdir 't' if -d 't'; - unshift @INC, '../lib'; + @INC = '../lib'; } # Test suite for the Term::ANSIColor Perl module. Before `make install' is @@ -13,7 +11,7 @@ BEGIN { # Ensure module can be loaded ############################################################################ -BEGIN { $| = 1; print "1..7\n" } +BEGIN { $| = 1; print "1..8\n" } END { print "not ok 1\n" unless $loaded } use Term::ANSIColor qw(:constants color colored); $loaded = 1; @@ -71,3 +69,13 @@ if (colored ("test\ntest\r\r\n\r\n", 'bold') } else { print "not ok 7\n"; } + +# Test the array ref form. +$Term::ANSIColor::EACHLINE = "\n"; +if (colored (['bold', 'on_green'], "test\n", "\n", "test") + eq "\e[1;42mtest\e[0m\n\n\e[1;42mtest\e[0m") { + print "ok 8\n"; +} else { + print colored (['bold', 'on_green'], "test\n", "\n", "test"); + print "not ok 8\n"; +}