| 1 |
Source: libtest-filename-perl |
| 2 |
Section: perl |
| 3 |
Priority: optional |
| 4 |
Build-Depends: |
| 5 |
debhelper-compat (= 13), |
| 6 |
libpath-tiny-perl, |
| 7 |
Maintainer: Debian Perl Group <[email protected]> |
| 8 |
Uploaders: Jonas Smedegaard <[email protected]> |
| 9 |
Standards-Version: 4.7.2 |
| 10 |
Vcs-Git: https://salsa.debian.org/perl-team/modules/packages/libtest-filename-perl.git |
| 11 |
Vcs-Browser: https://salsa.debian.org/perl-team/modules/packages/libtest-filename-perl |
| 12 |
Homepage: https://metacpan.org/release/Test-Filename |
| 13 |
Testsuite: autopkgtest-pkg-perl |
| 14 |
|
| 15 |
Package: libtest-filename-perl |
| 16 |
Architecture: all |
| 17 |
Multi-Arch: foreign |
| 18 |
Depends: |
| 19 |
libpath-tiny-perl, |
| 20 |
${misc:Depends}, |
| 21 |
${perl:Depends} |
| 22 |
Description: portable filename comparison |
| 23 |
Many cross-platform test failures -- particularly on Win32 -- are due |
| 24 |
to hard-coded file paths being used in comparison tests. |
| 25 |
. |
| 26 |
my $file = get_file(); # returns "foo\bar.t"; |
| 27 |
is( $file, "foo/bar.t" ); # fails on Win32 |
| 28 |
. |
| 29 |
Test::Filename provides some handy functions to convert all those path |
| 30 |
separators automatically so filename tests will just DWIM. |
| 31 |
. |
| 32 |
The alternative is to write your own utility subroutine and use it |
| 33 |
everywhere or just keep on littering your test code with calls to |
| 34 |
File::Spec -- yuck! |
| 35 |
. |
| 36 |
is( $file, File::Spec->canonpath("some/path"), "should pass" ); |
| 37 |
. |
| 38 |
Since this module is so simple, you might not think it worth including |
| 39 |
as a dependency. After all, it's not that hard to always remember to |
| 40 |
use File::Spec, Path::Tiny or some other file utility, right? But odds |
| 41 |
are that, at some point, you'll be so busy writing tests that you'll |
| 42 |
forget and hard-code a path in your haste to show what a clever |
| 43 |
programmer you are. |
| 44 |
. |
| 45 |
So just use this module and stop worrying about it. You'll be happier |
| 46 |
and so will anyone trying to install your modules on Win32. |