diff options
author | Steven Schubiger <stsc@refcnt.org> | 2019-09-13 21:15:22 +0200 |
---|---|---|
committer | Steven Schubiger <stsc@refcnt.org> | 2019-09-13 21:15:22 +0200 |
commit | b5ff1ba35b959261c855262b6e820732e72b0bfe (patch) | |
tree | b5b0cdc7ec3438b441e736d56bccf44785ae96ae /t/conf/attr_clear.t | |
parent | 763a5a99b3af4161cd1dd4c7ee2c450c4b6137a5 (diff) | |
parent | 660177bb22c5b8b54c0ec3aabd1930fd49584e23 (diff) | |
download | colorize-b5ff1ba35b959261c855262b6e820732e72b0bfe.tar.gz colorize-b5ff1ba35b959261c855262b6e820732e72b0bfe.tar.bz2 |
Merge branch 'config_file'
Diffstat (limited to 't/conf/attr_clear.t')
-rwxr-xr-x | t/conf/attr_clear.t | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/t/conf/attr_clear.t b/t/conf/attr_clear.t new file mode 100755 index 0000000..7bbe5f9 --- /dev/null +++ b/t/conf/attr_clear.t @@ -0,0 +1,31 @@ +#!/usr/bin/perl + +use strict; +use warnings; +use lib qw(lib); + +use Colorize::Common qw(:defaults $write_to_tmpfile); +use File::Temp qw(tmpnam); +use Test::More; + +my $tests = 1; + +plan tests => $tests; + +SKIP: { + my $program = tmpnam(); + my $conf_file = tmpnam(); + + skip 'compiling failed (attr clear)', $tests unless system(qq($compiler -DTEST -DCONF_FILE_TEST=\"$conf_file\" -o $program $source)) == 0; + + my $infile = $write_to_tmpfile->('foo'); + + open(my $fh, '>', $conf_file) or die "Cannot open `$conf_file' for writing: $!\n"; + print {$fh} "attr=blink\n"; + close($fh); + + is(qx($program default --attr=bold $infile), "\e[1;39mfoo\e[0m", 'discard conf attr string'); + + unlink $program; + unlink $conf_file; +} |