- SKIP: {
- my $program_buf = tmpnam();
- skip 'compiling failed (short buffer)', 1 unless system("gcc -DTEST -DBUF_SIZE=$BUF_SIZE{short} $warning_flags -o $program_buf $source") == 0;
+ is(qx(echo -n "\e[35mhello\e[0m \e[36mworld\e[0m" | $program $switch), 'hello world', "$type colored words");
+ is(qx(echo -n "hello world" | $program Magenta | $program $switch), 'hello world', "$type colored line");
+ is_deeply([split /\n/, qx($program cyan $infile1 | $program $switch)], [split /\n/, $text], "$type colored text");
+
+ ok(qx(echo -n "\e[\e[33m" | $program $switch) eq "\e[", "$type with invalid sequence");
+ };
+
+ $check_clean->($_) foreach qw(clean clean-all);
+
+ is(qx(echo -n "\e[4munderline\e[24m" | $program --clean-all), 'underline', 'clean-all color sequences');
+
+ my $check_clean_buf = sub
+ {
+ my ($program_buf, $type) = @_;
+
+ my $switch = "--$type";