Subject: | t/03test.t does not properly escape filesystem names when used in regular expressions. |
Filesystem mount points that contain special characters such as '+'
cause the test to fail because the filename is treated as a regular
expression. Example, consider a mount at: /mnt/c++source
I've attached a patch to fix this test
Subject: | SysFilesystem.patch |
--- Sys-Filesystem-1.30/t/03test.t 2010-07-15 15:33:42.000000000 -0400
+++ Sys-Filesystem-1.30-new/t/03test.t 2010-10-18 21:49:17.000000000 -0400
@@ -31,13 +31,13 @@
{
my $mounted = $fs->mounted($filesystem) || 0;
my $unmounted = !$mounted;
- ok( $mounted == grep( /^$filesystem$/, @mounted_filesystems ), 'Mounted' );
- ok( $unmounted == grep( /^$filesystem$/, @unmounted_filesystems ), 'Unmounted' );
+ ok( $mounted == grep( /^\Q$filesystem\E$/, @mounted_filesystems ), 'Mounted' );
+ ok( $unmounted == grep( /^\Q$filesystem\E$/, @unmounted_filesystems ), 'Unmounted' );
my $special = $fs->special($filesystem) || 0;
my $regular = !$special;
- ok( $special == grep( /^$filesystem$/, @special_filesystems ), 'Special' );
- ok( $regular == grep( /^$filesystem$/, @regular_filesystems ), 'Regular' );
+ ok( $special == grep( /^\Q$filesystem\E$/, @special_filesystems ), 'Special' );
+ ok( $regular == grep( /^\Q$filesystem\E$/, @regular_filesystems ), 'Regular' );
my ( $device, $options, $format, $volume, $label );
ok( $device = $fs->device($filesystem), "Get device for $filesystem" );