aboutsummaryrefslogtreecommitdiffstats
path: root/test.pl
diff options
context:
space:
mode:
authorGravatar Steven Schubiger <stsc@refcnt.org> 2013-07-03 23:40:37 +0200
committerGravatar Steven Schubiger <stsc@refcnt.org> 2013-07-03 23:40:37 +0200
commitbc00d671241fb5509b81a13efdf50cae616610d0 (patch)
tree834a17bc1a8199d93acb5d958ebe0ff0f9cad979 /test.pl
parent84ac1076aa25a687ddcaf3036ceeb0da6b5730dc (diff)
downloadcolorize-bc00d671241fb5509b81a13efdf50cae616610d0.tar.gz
colorize-bc00d671241fb5509b81a13efdf50cae616610d0.tar.bz2
Clean sequences more strictly
Diffstat (limited to 'test.pl')
-rwxr-xr-xtest.pl17
1 files changed, 16 insertions, 1 deletions
diff --git a/test.pl b/test.pl
index 373a4bc..056f818 100755
--- a/test.pl
+++ b/test.pl
@@ -7,7 +7,7 @@ use constant true => 1;
use File::Temp qw(tempfile tmpnam);
use Test::More;
-my $tests = 21;
+my $tests = 22;
my %BUF_SIZE = (
normal => 1024,
@@ -47,6 +47,21 @@ SKIP: {
is_deeply([split /\n/, qx(cat $infile1 | $program none/none)], [split /\n/, $text], 'text read from stdin');
is_deeply([split /\n/, qx($program none/none $infile1)], [split /\n/, $text], 'text read from file');
+ {
+ my @fg_colors = (30..37, 39);
+ my @bg_colors = (40..47, 49);
+
+ my @bold_colors = map "1;$_", @fg_colors;
+
+ my @values = (@fg_colors, @bg_colors, @bold_colors, 0);
+
+ my $ok = true;
+ foreach my $value (@values) {
+ $ok &= qx(echo -n "\e[${value}m" | $program --clean) eq '';
+ }
+ ok($ok, 'clean color sequences');
+ }
+
my $check_clean = sub
{
my ($type) = @_;