+ is(qx(printf %s "\e[35mhello\e[0m \e[36mworld\e[0m" | $valgrind_cmd$program $switch), 'hello world', "$type colored words");
+ is(qx(printf %s "hello world" | $program Magenta | $valgrind_cmd$program $switch), 'hello world', "$type colored line");
+ is_deeply([split /\n/, qx($program cyan $infile1 | $valgrind_cmd$program $switch)], [split /\n/, $text], "$type colored text");
+
+ ok(qx(printf %s "\e[\e[33m" | $valgrind_cmd$program $switch) eq "\e[", "$type with invalid sequence");
+ };
+
+ $check_clean->($_) foreach qw(clean clean-all);
+
+ is(qx(printf %s "\e[4munderline\e[24m" | $valgrind_cmd$program --clean-all), 'underline', 'clean-all color sequences');
+
+ my $check_clean_buf = sub
+ {
+ my ($program_buf, $type) = @_;
+
+ my $switch = "--$type";
+
+ # Check that line chunks are printed when cleaning text without sequences