SYN SYN
[p5sagit/p5-mst-13.2.git] / t / lib / ansicolor.t
index 3e16dce..f38e905 100755 (executable)
@@ -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";
+}