aboutsummaryrefslogtreecommitdiffstats
path: root/test.pl
diff options
context:
space:
mode:
authorGravatar Steven Schubiger <stsc@refcnt.org> 2018-02-02 13:41:35 +0100
committerGravatar Steven Schubiger <stsc@refcnt.org> 2018-02-02 13:41:35 +0100
commit873cb28ff8c8e0a4b64cc872878a72b5fcd66a98 (patch)
tree6da464cf9f185106bcfb6ecf8b836a4322287d3e /test.pl
parent50c854a0abbb5a741c35b718bb1bf04eb84985d5 (diff)
parenta9d54ff20482e80ea17deb5a431f1bbae3a91637 (diff)
downloadcolorize-873cb28ff8c8e0a4b64cc872878a72b5fcd66a98.tar.gz
colorize-873cb28ff8c8e0a4b64cc872878a72b5fcd66a98.tar.bz2
Merge branch 'opt_omit_color_empty'
Diffstat (limited to 'test.pl')
-rwxr-xr-xtest.pl9
1 files changed, 8 insertions, 1 deletions
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');