]>
git.refcnt.org Git - colorize.git/blob - t/conf/use.t
7 use Colorize
::Common
qw(:defaults $write_to_tmpfile);
8 use File::Temp qw(tmpnam);
15 color=yellow # tested also in color.t
22 my $program = tmpnam
();
23 my $conf_file = tmpnam
();
25 skip
'compiling failed (use config)', $tests unless system(qq($compiler -DTEST
-DCONF_FILE_TEST
=\"$conf_file\" -o
$program $source)) == 0;
27 my $infile1 = $write_to_tmpfile->(<<'EOT');
34 open(my $fh, '>', $conf_file) or die "Cannot open `$conf_file' for writing: $!\n";
38 is
(qx($program $infile1), <<"EOT", 'use config');
45 my $infile2 = $write_to_tmpfile->('foo');
47 open($fh, '>', $conf_file) or die "Cannot open `$conf_file' for writing: $!\n";
48 print {$fh} "exclude-random=black\n";
51 for (my $i = 1; $i <= 20; $i++) {
52 like
(qx($program random
$infile2), qr/^\e\[3[1-7]mfoo\e\[0m$/, 'use exclude-random');