diff options
author | Steven Schubiger <stsc@refcnt.org> | 2013-03-03 15:28:31 +0100 |
---|---|---|
committer | Steven Schubiger <stsc@refcnt.org> | 2013-03-03 15:28:31 +0100 |
commit | c4d422dc0f693d0fdbfc3225cea2007a84f3c55a (patch) | |
tree | d4106138b584b2bc099966806775467709a91997 /test.pl | |
parent | eb0992cd2850cbb12690c5cc74425d4ef7251556 (diff) | |
download | colorize-c4d422dc0f693d0fdbfc3225cea2007a84f3c55a.tar.gz colorize-c4d422dc0f693d0fdbfc3225cea2007a84f3c55a.tar.bz2 |
Test count of sequences being printed
Diffstat (limited to 'test.pl')
-rwxr-xr-x | test.pl | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -7,7 +7,7 @@ use constant true => 1; use File::Temp qw(tempfile tmpnam); use Test::More; -my $tests = 14; +my $tests = 15; my %BUF_SIZE = ( normal => 1024, @@ -69,6 +69,11 @@ SKIP: { is_deeply([split /\n/, qx(cat $infile2 | $program none/none)], [split /\n/, $repeated], "read ${\length $repeated} bytes (BUF_SIZE=$BUF_SIZE{normal})"); + my $colored_text = qx(echo "foo bar baz" | $program red); + my $sequences = 0; + $sequences++ while $colored_text =~ /\e\[\d+m/g; + is($sequences, 2, 'count of sequences printed'); + is(qx(echo -n "hello\nworld\r\n" | $program none/none), "hello\nworld\r\n", 'stream mode'); is(system("echo \"hello world\" | $program random --exclude-random=black >/dev/null 2>&1"), 0, 'switch exclude-random'); |