]> git.refcnt.org Git - colorize.git/blob - t/conf/attr_clear.t
Add new test files
[colorize.git] / t / conf / attr_clear.t
1 #!/usr/bin/perl
2
3 use strict;
4 use warnings;
5 use lib qw(lib);
6
7 use Colorize::Common qw(:defaults $write_to_tmpfile);
8 use File::Temp qw(tmpnam);
9 use Test::More;
10
11 my $tests = 1;
12
13 plan tests => $tests;
14
15 SKIP: {
16 my $program = tmpnam();
17 my $conf_file = tmpnam();
18
19 skip 'compiling failed (attr clear)', $tests unless system(qq($compiler -DTEST -DCONF_FILE_TEST=\"$conf_file\" -o $program $source)) == 0;
20
21 my $infile = $write_to_tmpfile->('foo');
22
23 open(my $fh, '>', $conf_file) or die "Cannot open `$conf_file' for writing: $!\n";
24 print {$fh} "attr=blink\n";
25 close($fh);
26
27 is(qx($program default --attr=bold $infile), "\e[1;39mfoo\e[0m", 'discard conf attr string');
28
29 unlink $program;
30 unlink $conf_file;
31 }