Permalink
Browse files

t/run/options: test -V and -h

Run the tests for --version and --help again.
  • Loading branch information...
Benabik committed Jan 26, 2012
1 parent 7ef799e commit f83019ff3c3d6b9ea5a2d0040544cc736c649076
Showing with 9 additions and 8 deletions.
  1. +9 −8 t/run/options.t
View
@@ -19,17 +19,19 @@ use strict;
use warnings;
use lib qw( lib . ../lib ../../lib );
-use Test::More tests => 35;
+use Test::More tests => 38;
use Parrot::Config;
use File::Temp 0.13 qw/tempfile/;
use File::Spec;
my $PARROT = ".$PConfig{slash}$PConfig{test_prog}";
# looking at the help message
-my $help_message = `$PARROT --help`;
-is( substr( $help_message, 0, 23 ), 'parrot [Options] <file>', 'Start of help message' );
-ok( index( $help_message, '-t --trace [flags]' ) > 0, 'help for --trace' );
+for my $help ('-h', '--help') {
+ my $help_message = `$PARROT $help`;
+ is( substr( $help_message, 0, 23 ), 'parrot [Options] <file>', "Start of $help message" );
+ ok( index( $help_message, '-t --trace [flags]' ) > 0, '$help for --trace' );
+}
# setup PIR files for tests below
my $first_pir_file = create_pir_file('first');
@@ -145,13 +147,12 @@ open(my $version_fh, "<", "VERSION") or die "couldn't open VERSION: $!";
my $file_version = <$version_fh>;
chomp($file_version);
close($version_fh);
-like( qx{$PARROT --version}, qr/.*${file_version}.*/, "VERSION matches --version" );
+for my $version ('-V', '--version') {
+ like( qx{$PARROT $version}, qr/.*${file_version}.*/, "VERSION matches $version" );
+}
## GH #346 test remaining options
-# TODO: Add tests for short options
-# -h --help
-# -V --version
# TODO: Add tests for long options
# -D --parrot-debug
# TODO: Add tests for attached options

0 comments on commit f83019f

Please sign in to comment.