X-Git-Url: http://git.refcnt.org/?p=colorize.git;a=blobdiff_plain;f=test.pl;h=85e12b5d1f345bd64c6c43e6e938d672f37b75da;hp=3ddec2d824ac5affbc9493894e07ea321066cb11;hb=b03f1cd686c25a4b76c523ccc70c29398afddc47;hpb=bcd256396593896a9e2c287afead4bbfbd65a437 diff --git a/test.pl b/test.pl index 3ddec2d..85e12b5 100755 --- a/test.pl +++ b/test.pl @@ -12,7 +12,7 @@ use Getopt::Long qw(:config no_auto_abbrev no_ignore_case); use Test::Harness qw(runtests); use Test::More; -my $tests = 29; +my $tests = 30; my $valgrind_cmd = ''; { @@ -143,6 +143,13 @@ SKIP: { is(system(qq(printf '%s\n' "hello world" | $valgrind_cmd$program random --exclude-random=black >/dev/null)), 0, 'switch exclude-random'); + { + my $infile = $write_to_tmpfile->("foo\n\nbar"); + is_deeply([split /\n/, qx($valgrind_cmd$program yellow --omit-color-empty $infile)], + [split /\n/, "\e[33mfoo\e[0m\n\n\e[33mbar\e[0m"], + 'switch omit-color-empty'); + } + SKIP: { skip 'valgrind not found', 1 unless system('which valgrind >/dev/null 2>&1') == 0; like(qx(valgrind $program none/none $infile1 2>&1 >/dev/null), qr/no leaks are possible/, 'valgrind memleaks');