- 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');
+ is_deeply([split /\n/, qx(cat $infile1 | $valgrind_cmd$program none/none)], [split /\n/, $text], 'text read from stdin');
+ is_deeply([split /\n/, qx($valgrind_cmd$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(printf %s "\e[${value}m" | $valgrind_cmd$program --clean) eq '';
+ }
+ ok($ok, 'clean color sequences');
+ }