+ is(qx(echo -n "\e[35mhello\e[0m \e[36mworld\e[0m" | $program --clean), 'hello world', 'clean colored words');
+ is(qx(echo -n "hello world" | $program Magenta | $program --clean), 'hello world', 'clean colored line');
+ is_deeply([split /\n/, qx($program cyan $infile1 | $program --clean)], [split /\n/, $text], 'clean colored text');
+
+ ok(qx(echo -n "\e[\e[33m" | $program --clean) eq "\e[", 'clean with invalid sequence');
+
+ SKIP: {
+ $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;
+
+ # Check that line chunks are merged when cleaning text
+ my $short_text = 'Linux dev 2.6.32-5-openvz-686 #1 SMP Sun Sep 23 11:40:07 UTC 2012 i686 GNU/Linux';
+ is(qx(echo -n "$short_text" | $program_buf --clean), $short_text, "merge ${\length $short_text} bytes (BUF_SIZE=$BUF_SIZE{short})");
+ }
+