Author: jkeenan
Date: Sun May 13 16:28:18 2007
New Revision: 18527
Modified:
branches/reconfigure/t/configure/step.t
Log:
Extend test coverage of Parrot::Configure::Step by providing test for
file_checksum with $ignore_pattern argument (not previously tested).
Modified: branches/reconfigure/t/configure/step.t
==============================================================================
--- branches/reconfigure/t/configure/step.t (original)
+++ branches/reconfigure/t/configure/step.t Sun May 13 16:28:18 2007
@@ -7,7 +7,7 @@
use lib qw( . lib ../lib ../../lib );
-use Test::More tests => 19;
+use Test::More qw(no_plan); # tests => 20;
use File::Basename qw(basename dirname);
use File::Temp 0.13 qw/tempfile/;
@@ -24,7 +24,7 @@
=head1 DESCRIPTION
-Regressions tests for the L<Parrote::Configure::Step> module.
+Regression tests for the L<Parrote::Configure::Step> module.
=cut
@@ -51,10 +51,25 @@
my ( $tmpfile, $fname ) = tempfile( UNLINK => 1 );
print $tmpfile "foo" x 1000;
$tmpfile->flush;
- is( Parrot::Configure::Step::file_checksum("$fname"),
+ is( Parrot::Configure::Step::file_checksum($fname),
'324000', "file_checksum() returns correct checksum" );
}
+{
+ my ( $tmpfile, $fname ) = tempfile( UNLINK => 1 );
+ my $str = 'Do not print this line';
+ print $tmpfile "foo" x 500;
+ print $tmpfile "\n";
+ print $tmpfile "$str\n";
+ print $tmpfile "foo" x 500;
+ $tmpfile->flush;
+ my $ignore_pattern = qr/$str/;
+ my $csum = Parrot::Configure::Step::file_checksum(
+ $fname, $ignore_pattern
+ );
+ is( $csum, '324010', "file_checksum() returns correct checksum" );
+}
+
# copy_if_diff()
{