Update of /cvsroot/module-build/Module-Build/t
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1555/t
Modified Files:
destinations.t
Log Message:
Add tests to make sure prefixification does not go outside the prefix.
This is currently broken and the tests are TODO.
Added better names to the test subroutines.
Index: destinations.t
===================================================================
RCS file: /cvsroot/module-build/Module-Build/t/destinations.t,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- destinations.t 21 Jun 2005 00:03:15 -0000 1.11
+++ destinations.t 21 Jun 2005 22:08:13 -0000 1.12
@@ -13,7 +13,7 @@
}
-use Test::More tests => 49;
+use Test::More tests => 55;
use_ok 'Module::Build';
@@ -100,6 +100,19 @@
is( $m->installdirs, 'site' );
+# Try a config setting which would result in installation locations outside
+# the prefix. Ensure it doesn't.
+TODO: {
+ local $TODO = 'prefix doesnt protect against going outside itself';
+
+ $m->{config}{siteprefixexp} = '/wierd/prefix';
+
+ $prefix = catdir('another', 'prefix');
+ $m->prefix($prefix);
+ test_prefix($prefix);
+}
+
+
# Check that we can use install_base after setting prefix.
$m->install_base( $install_base );
@@ -120,7 +133,7 @@
foreach my $type (qw(lib arch bin script bindoc libdoc)) {
my $dest = $m->install_destination( $type );
- like( $dest, "/^\Q$prefix\E/");
+ like( $dest, "/^\Q$prefix\E/", "$type prefixed");
}
}
@@ -131,6 +144,6 @@
local $Test::Builder::Level = $Test::Builder::Level + 1;
while( my($type, $expect) = each %$expect ) {
- is( $m->install_destination($type), $expect, $type );
+ is( $m->install_destination($type), $expect, "$type destination" );
}
}
|