use Test;
-BEGIN { plan tests => 6 }
+BEGIN { plan tests => 8 }
use strict;
+BEGIN {
# Cwd::cwd does an implicit "require Win32", but
# the ../lib directory in @INC will no longer work once
# we chdir() out of the "t" directory.
-use Win32;
+ if ($^O eq 'MSWin32') {
+ require Win32;
+ Win32->import();
+ }
+}
use File::CheckTree;
use File::Spec; # used to get absolute paths
# indented comment, followed blank line (w/o whitespace):
README -f
- $path_to_README -e || warn
+ '$path_to_README' -e || warn
};
};
+ print STDERR $_ for @warnings;
if ( !$@ && !@warnings && defined($num_warnings) && $num_warnings == 0 ) {
ok(1);
}
eval {
$num_warnings = validate qq{
lib -d || die
- $path_to_libFile cd
+ '$path_to_libFile' cd
Spec -e
Spec -f
- $path_to_dist cd
+ '$path_to_dist' cd
README -ef
INSTALL -d || warn
- $path_to_libFile -d || die
+ '$path_to_libFile' -d || die
};
};
ok(0);
}
}
+
+#### TEST 7 -- Quoted file names ####
+{
+ my $num_warnings;
+ eval {
+ $num_warnings = validate q{
+ "a file with whitespace" !-ef
+ 'a file with whitespace' !-ef
+ };
+ };
+
+ if ( !$@ ) {
+ # No errors mean we compile correctly
+ ok(1);
+ } else {
+ ok(0);
+ print STDERR $@;
+ };
+}
+
+#### TEST 8 -- Malformed query ####
+{
+ my $num_warnings;
+ eval {
+ $num_warnings = validate q{
+ a file with whitespace !-ef
+ };
+ };
+
+ if ( $@ =~ /syntax error/) {
+ # We got a syntax error for a malformed file query
+ ok(1);
+ } else {
+ ok(0);
+ };
+}