diff --git a/tests/argument-check.t b/tests/argument-check.t index 44686ae..1c63ac4 100644 --- a/tests/argument-check.t +++ b/tests/argument-check.t @@ -5,7 +5,7 @@ # # Steve # -- -# $Id: argument-check.t,v 1.4 2006-06-09 22:03:30 steve Exp $ +# $Id: argument-check.t,v 1.5 2006-06-13 13:26:00 steve Exp $ # use strict; @@ -40,10 +40,10 @@ foreach my $key ( sort keys %OPTIONS ) foreach my $line ( @lines ) { - if ( $line =~ /--$key/ ) - { - $found = 1; - } + if ( $line =~ /--$key/ ) + { + $found = 1; + } } is( $found, 1 , " Found documentation for '$key'" ); @@ -75,38 +75,38 @@ sub parseConfigFile while (defined($line = ) ) { chomp $line; - if ($line =~ s/\\$//) - { - $line .= ; - redo unless eof(FILE); - } + if ($line =~ s/\\$//) + { + $line .= ; + redo unless eof(FILE); + } - # Skip blank lines - next if ( length( $line ) < 1 ); + # Skip blank lines + next if ( length( $line ) < 1 ); - # Find variable settings - if ( $line =~ /([^=]+)=([^\n]+)/ ) - { - my $key = $1; - my $val = $2; + # Find variable settings + if ( $line =~ /([^=]+)=([^\n]+)/ ) + { + my $key = $1; + my $val = $2; - if ( $key =~ /([ \t#]*)(.*)/ ) - { - $key = $2; - } + if ( $key =~ /([ \t#]*)(.*)/ ) + { + $key = $2; + } - # Strip leading and trailing whitespace. - $key =~ s/^\s+//; - $key =~ s/\s+$//; - $val =~ s/^\s+//; - $val =~ s/\s+$//; - - next if ( $key =~ /--/ ); + # Strip leading and trailing whitespace. + $key =~ s/^\s+//; + $key =~ s/\s+$//; + $val =~ s/^\s+//; + $val =~ s/\s+$//; + + next if ( $key =~ /--/ ); - # Store value. - $CONFIG{ $key } = $val; - } + # Store value. + $CONFIG{ $key } = $val; + } } close( FILE ); diff --git a/tests/hook-inittab.t b/tests/hook-inittab.t index fe1dd20..7caa749 100644 --- a/tests/hook-inittab.t +++ b/tests/hook-inittab.t @@ -4,7 +4,7 @@ # # Steve # -- -# $Id: hook-inittab.t,v 1.2 2006-06-09 15:12:33 steve Exp $ +# $Id: hook-inittab.t,v 1.3 2006-06-13 13:26:00 steve Exp $ # use strict; @@ -35,7 +35,7 @@ sub testHook # # Create a temporary directory, and copy our inittab into it. # - my $dir = File::Temp::tempdir( CLEANUP => 1 ); + my $dir = File::Temp::tempdir( CLEANUP => 1 ); mkdir( $dir . "/etc", 0777 ); File::Copy::cp( "/etc/inittab", $dir . "/etc" ); @@ -72,21 +72,21 @@ sub testHook my $count = 0; foreach my $line ( @lines ) { - if ( $line =~ /^([1-9])(.*) (.*)$/ ) - { - # - # This should be our only line: - # - # 1:2345:respawn:/sbin/getty 38400 console - # - ok( $1 eq "1", "We found the first getty line." ); - ok( $3 eq "console", "Which does use the console driver." ); - } + if ( $line =~ /^([1-9])(.*) (.*)$/ ) + { + # + # This should be our only line: + # + # 1:2345:respawn:/sbin/getty 38400 console + # + ok( $1 eq "1", "We found the first getty line." ); + ok( $3 eq "console", "Which does use the console driver." ); + } - if ( $line =~ /^(.).*getty/ ) - { - $count += 1 if ( $1 ne "#" ); - } + if ( $line =~ /^(.).*getty/ ) + { + $count += 1 if ( $1 ne "#" ); + } } ok( $count = 1, "Only found one uncommented getty line" ); diff --git a/tests/hooks.t b/tests/hooks.t index fff6c36..08eefab 100644 --- a/tests/hooks.t +++ b/tests/hooks.t @@ -4,7 +4,7 @@ # # Steve # -- -# $Id: hooks.t,v 1.4 2006-06-09 15:12:33 steve Exp $ +# $Id: hooks.t,v 1.5 2006-06-13 13:26:00 steve Exp $ # use strict; @@ -29,11 +29,11 @@ sub testDistroHooks # foreach my $file ( glob( "hooks/$dist/*" ) ) { - if ( ! -d $file ) - { - ok( -e $file, "$file" ); - ok( -x $file, " File is executable: $file" ); - } + if ( ! -d $file ) + { + ok( -e $file, "$file" ); + ok( -x $file, " File is executable: $file" ); + } } } diff --git a/tests/no-tabs.t b/tests/no-tabs.t index c7da17a..6350dd4 100644 --- a/tests/no-tabs.t +++ b/tests/no-tabs.t @@ -4,7 +4,7 @@ # # Steve # -- -# $Id: no-tabs.t,v 1.1 2006-06-13 13:21:45 steve Exp $ +# $Id: no-tabs.t,v 1.2 2006-06-13 13:26:00 steve Exp $ use strict; @@ -35,13 +35,12 @@ sub checkFile # Nor about backup files. return if ( $file =~ /~$/ ); - # Nor about files which start with ./debian/ + ./tests/ + # Nor about files which start with ./debian/ return if ( $file =~ /^\.\/debian\// ); - return if ( $file =~ /^\.\/tests\// ); # See if it is a shell/perl file. - my $isShell = 0; - my $isPerl = 0; + my $isShell = 0; + my $isPerl = 0; # Read the file. open( INPUT, "<", $file ); @@ -51,7 +50,7 @@ sub checkFile ( $line =~ /\/bin\/bash/ ) ) { $isShell = 1; - } + } if ( $line =~ /\/usr\/bin\/perl/ ) { $isPerl = 1; @@ -64,12 +63,12 @@ sub checkFile # if ( $isShell || $isPerl ) { - # - # Count TAB characters - # - my $count = countTabCharacters( $file ); + # + # Count TAB characters + # + my $count = countTabCharacters( $file ); - is( $count, 0, "Script has no tab characters: $file" ); + is( $count, 0, "Script has no tab characters: $file" ); } } @@ -88,11 +87,11 @@ sub countTabCharacters or die "Cannot open $file - $!"; foreach my $line ( ) { - while( $line =~ /(.*)\t(.*)/ ) - { - $count += 1; - $line = $1 . $2; - } + while( $line =~ /(.*)\t(.*)/ ) + { + $count += 1; + $line = $1 . $2; + } } close( FILE ); diff --git a/tests/perl-syntax.t b/tests/perl-syntax.t index 1aa6116..ff3c504 100644 --- a/tests/perl-syntax.t +++ b/tests/perl-syntax.t @@ -4,7 +4,7 @@ # # Steve # -- -# $Id: perl-syntax.t,v 1.1 2006-06-10 20:45:10 steve Exp $ +# $Id: perl-syntax.t,v 1.2 2006-06-13 13:26:00 steve Exp $ use strict; @@ -44,10 +44,10 @@ sub checkFile open( INPUT, "<", $file ); foreach my $line ( ) { - if ( $line =~ /\/usr\/bin\/perl/ ) - { - $isPerl = 1; - } + if ( $line =~ /\/usr\/bin\/perl/ ) + { + $isPerl = 1; + } } close( INPUT ); diff --git a/tests/plugin-checks.t b/tests/plugin-checks.t index 9081edf..2d10563 100644 --- a/tests/plugin-checks.t +++ b/tests/plugin-checks.t @@ -5,7 +5,7 @@ # # Steve # -- -# $Id: plugin-checks.t,v 1.3 2006-06-09 15:12:33 steve Exp $ +# $Id: plugin-checks.t,v 1.4 2006-06-13 13:26:00 steve Exp $ # @@ -31,16 +31,16 @@ sub testPlugins # foreach my $file ( glob( "hooks/$dist/*" ) ) { - ok( -e $file, "$file" ); + ok( -e $file, "$file" ); - if ( -f $file ) - { - # - # Make sure the file is OK - # - my $result = testFile( $file ); - is( $result, 0, " File contains no mention of the config hash" ); - } + if ( -f $file ) + { + # + # Make sure the file is OK + # + my $result = testFile( $file ); + is( $result, 0, " File contains no mention of the config hash" ); + } } } @@ -58,11 +58,11 @@ sub testFile foreach my $line ( ) { - if ( $line =~ /\$CONFIG{[ \t'"]+(.*)[ \t'"]+}/ ) - { - close( FILY ); - return $line; - } + if ( $line =~ /\$CONFIG{[ \t'"]+(.*)[ \t'"]+}/ ) + { + close( FILY ); + return $line; + } } close( FILY ); diff --git a/tests/pod-check.t b/tests/pod-check.t index 5bc77c9..73cc71f 100644 --- a/tests/pod-check.t +++ b/tests/pod-check.t @@ -5,7 +5,7 @@ # # Steve # -- -# $Id: pod-check.t,v 1.4 2006-06-09 15:12:33 steve Exp $ +# $Id: pod-check.t,v 1.5 2006-06-13 13:26:01 steve Exp $ # use strict; @@ -19,15 +19,15 @@ foreach my $file ( glob( "bin/*-*" ) ) if ( ( -x $file ) && ( ! -d $file ) ) { - # - # Execute the command giving STDERR to STDOUT where we - # can capture it. - # - my $cmd = "podchecker $file"; - my $output = `$cmd 2>&1`; - chomp( $output ); + # + # Execute the command giving STDERR to STDOUT where we + # can capture it. + # + my $cmd = "podchecker $file"; + my $output = `$cmd 2>&1`; + chomp( $output ); - is( $output, "$file pod syntax OK.", " File has correct POD syntax: $file" ); + is( $output, "$file pod syntax OK.", " File has correct POD syntax: $file" ); } } diff --git a/tests/shell-syntax.t b/tests/shell-syntax.t index 0a0fff6..e5f657f 100644 --- a/tests/shell-syntax.t +++ b/tests/shell-syntax.t @@ -4,7 +4,7 @@ # # Steve # -- -# $Id: shell-syntax.t,v 1.1 2006-06-10 20:50:14 steve Exp $ +# $Id: shell-syntax.t,v 1.2 2006-06-13 13:26:01 steve Exp $ use strict; @@ -41,11 +41,11 @@ sub checkFile open( INPUT, "<", $file ); foreach my $line ( ) { - if ( ( $line =~ /\/bin\/sh/ ) || - ( $line =~ /\/bin\/bash/ ) ) - { - $isShell = 1; - } + if ( ( $line =~ /\/bin\/sh/ ) || + ( $line =~ /\/bin\/bash/ ) ) + { + $isShell = 1; + } } close( INPUT ); diff --git a/tests/xen-delete-image.t b/tests/xen-delete-image.t index 515c80d..87669ca 100644 --- a/tests/xen-delete-image.t +++ b/tests/xen-delete-image.t @@ -5,7 +5,7 @@ # # Steve # -- -# $Id: xen-delete-image.t,v 1.3 2006-06-09 15:12:33 steve Exp $ +# $Id: xen-delete-image.t,v 1.4 2006-06-13 13:26:01 steve Exp $ # @@ -17,7 +17,7 @@ use File::Temp; # # Create a temporary directory. # -my $dir = File::Temp::tempdir( CLEANUP => 1 ); +my $dir = File::Temp::tempdir( CLEANUP => 1 ); my $domains = $dir . "/domains"; # diff --git a/tests/xen-lists-images.t b/tests/xen-lists-images.t index fa41926..e27d1a3 100644 --- a/tests/xen-lists-images.t +++ b/tests/xen-lists-images.t @@ -6,7 +6,7 @@ # # Steve # -- -# $Id: xen-lists-images.t,v 1.3 2006-06-09 15:12:33 steve Exp $ +# $Id: xen-lists-images.t,v 1.4 2006-06-13 13:26:01 steve Exp $ # @@ -18,7 +18,7 @@ use File::Temp; # # Create a temporary directory. # -my $dir = File::Temp::tempdir( CLEANUP => 1 ); +my $dir = File::Temp::tempdir( CLEANUP => 1 ); my $domains = $dir . "/domains"; # @@ -78,15 +78,15 @@ foreach my $line ( split( /\n/, $output ) ) { if ( $line =~ /Image: $one/ ) { - ok( 1, "First image found" ); + ok( 1, "First image found" ); } elsif ( $line =~ /Image: $two/ ) { - ok( 1, "Second image found" ); + ok( 1, "Second image found" ); } else { - ok( 0, "Unexpected output : $line " ); + ok( 0, "Unexpected output : $line " ); } }