Subject: | Wrong error diagnostic when one of the files can't be opened |
Date: | Wed, 11 Feb 2009 16:49:02 +0100 |
To: | <bug-Test-File-Contents [...] rt.cpan.org> |
From: | L. Alberto Giménez <lagimenez [...] capside.com> |
Hi,
There is a bug in Test::File::Contents::file_contents_identical (v0.05) that
outputs the wrong error message when one of the two files to compare does
not exist (or can't be opened for reading).
The method code switches the file names when issuing the error (says $file1
does not exist when $file2 is the one that actually does not exist and vice
versa).
The following patch fixes the problem:
--- /usr/local/share/perl/5.8.8/Test/File/Contents.pm 2009-02-11
16:30:56.000000000 +0100
+++ /home/lagimenez/Contents.pm 2009-02-11 16:31:46.000000000 +0100
@@ -188,12 +188,12 @@
return 0;
}
} else {
- $Test->diag("Could not open file $file1: $!");
+ $Test->diag("Could not open file $file2: $!");
$Test->ok(0, $desc);
return 0;
}
} else {
- $Test->diag("Could not open file $file2: $!");
+ $Test->diag("Could not open file $file1: $!");
$Test->ok(0, $desc);
return 0;
}
Best regards,
L. Alberto Giménez
Systems Engineer
CAPSiDE
w w w . c a p s i d e . c o m