From e4adff473d0f4dfa129e44f02a0bfc650f73a32c Mon Sep 17 00:00:00 2001 From: "Andreas J. Koenig" Date: Sun, 15 Jun 2008 11:40:20 +0200 Subject: [PATCH] add a test for the help option --- t/run.t | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/t/run.t b/t/run.t index 15249c4..9c5496b 100644 --- a/t/run.t +++ b/t/run.t @@ -10,7 +10,7 @@ my @s = qw( bin/ctgetreports ); -my $tests_per_loop = 1; +my $tests_per_loop = 3; my $plan = scalar @s * $tests_per_loop; plan tests => $plan; @@ -24,7 +24,19 @@ for my $s (1..@s) { } my $ret = close $fh; ok 1==$ret, "$script:-c:$ret"; + open $fh, "-|", qq{"$^X" "-Ilib" "$script" "-help" 2>&1} or die "could not fork: $!"; + my $seen_usage = 0; + while (<$fh>) { + $seen_usage++ if /Usage:/; + } + my $ret = close $fh; + ok 1==$ret, "$script:-help:ret=$ret"; + ok 0<$seen_usage, "$script:-help:su=$seen_usage"; } __END__ +# Local Variables: +# mode: cperl +# cperl-indent-level: 2 +# End: -- 2.11.4.GIT