]> git.refcnt.org Git - colorize.git/blobdiff - test.pl
Omit declaration of optind/optarg
[colorize.git] / test.pl
diff --git a/test.pl b/test.pl
index 85e12b5d1f345bd64c6c43e6e938d672f37b75da..928c6987054f644dd06e48baac2b384118a05c85 100755 (executable)
--- a/test.pl
+++ b/test.pl
@@ -7,12 +7,13 @@ use constant true  => 1;
 use constant false => 0;
 
 use Colorize::Common qw(:defaults $compiler_flags %BUF_SIZE $valgrind_command $write_to_tmpfile);
+use File::Find;
 use File::Temp qw(tmpnam);
 use Getopt::Long qw(:config no_auto_abbrev no_ignore_case);
 use Test::Harness qw(runtests);
 use Test::More;
 
-my $tests = 30;
+my $tests = 32;
 
 my $valgrind_cmd = '';
 {
@@ -28,8 +29,9 @@ my $valgrind_cmd = '';
 }
 
 {
-    my @test_files = glob('t/*.t');
-    eval { runtests(@test_files) } or warn $@;
+    my @test_files;
+    find ({ wanted => sub { push @test_files, $File::Find::name if /\.t$/ } }, 't');
+    eval { runtests(sort @test_files) } or warn $@;
 }
 
 plan tests => $tests;
@@ -96,6 +98,14 @@ SKIP: {
         }
 
         ok(qx(printf %s "\e[\e[33m" | $valgrind_cmd$program $switch) eq "\e[", "$type with invalid sequence");
+
+        {
+            my $ok = true;
+            foreach my $option (qw(--attr=bold --exclude-random=black --omit-color-empty)) {
+                $ok &= qx($valgrind_cmd$program $option $switch $infile1 2>&1 >/dev/null) =~ /switch has no meaning with/;
+            }
+            ok($ok, "$type strict options");
+        }
     };
 
     $check_clean->($_) foreach qw(clean clean-all);