1
0
mirror of synced 2026-02-04 07:12:45 +00:00

2006-06-22 15:01:53 by steve

Updated comments.
This commit is contained in:
steve
2006-06-22 15:01:53 +00:00
parent 11f5c569e0
commit 7b591358e6

View File

@@ -7,7 +7,7 @@
#
# Steve
# --
# $Id: getopt.t,v 1.1 2006-06-22 14:52:58 steve Exp $
# $Id: getopt.t,v 1.2 2006-06-22 15:01:53 steve Exp $
use strict;
@@ -25,10 +25,9 @@ foreach my $file ( sort( glob "./bin/*-*" ) )
#
# Check a file.
# Check that the given file implements all the option processing it
# is supposed to.
#
# If this is a perl file then call "perl -c $name", otherwise
# return
#
sub testFile
{
@@ -55,12 +54,15 @@ sub testFile
}
#
# Test we got some options
# Test we discovered some documented options.
#
ok( $#documented > 1, "We found some options documented." );
#
# Now read the input file.
# Now read the input file so that we can see if these advertised
# options are actually used.
#
open( IN, "<", $file ) or die "Failed to open file for reading $file - $!";
my @LINES = <IN>;
@@ -78,6 +80,10 @@ sub testFile
my $complete = join( "\n", @LINES );
if ( $complete =~ /GetOptions\(([^\)]+)\)/mi )
{
#
# Multi-line text which should have all the options we've
# invoked GetOptions with.
#
my $opt = $1;
#
@@ -118,12 +124,15 @@ sub testFile
#
# Phew. Now we're done.
#
# This option '$o' is something we call GetOptions with.
#
$accepted{$o} = 1;
}
}
#
# Now we want to find an option that is not documented.
# Now we want to make sure that each documented option is
# present in the list of options we pass to getopt.
#
foreach my $argument ( @documented )
{