glob-basic.t revision 7c478bd95313f5f23a4c958a745db2134aa03244
#!./perl
BEGIN {
chdir 't' if -d 't';
} else {
}
print "1..0\n";
exit 0;
}
print "1..9\n";
}
END {
}
use Cwd ();
$loaded = 1;
print "ok 1\n";
sub array {
}
# look for the contents of the current directory
@correct = ();
closedir D;
}
@a = sort @a;
print "# |@a| ne |@correct|\nnot ";
}
print "ok 2\n";
# look up the user's home directory
# should return a list with one item, and not set ERROR
eval {
1;
print "not ";
}
};
}
print "ok 3\n";
# check backslashing
# should return a list with one item, and not set ERROR
local $/ = "][";
print "# [@a]\n";
print "not ";
}
print "ok 4\n";
# check nonexistent checks
# should return an empty list
# XXX since errfunc is NULL on win32, this test is not valid there
print "# |@a|\nnot ";
}
print "ok 5\n";
# check bad protections
# should return an empty list, and set ERROR
{
print "ok 6 # skipped\n";
}
else {
#print "\@a = ", array(@a);
print "not ";
}
print "ok 6\n";
}
# check for csh style globbing
print "not ";
}
print "ok 7\n";
@a = bsd_glob(
'{TES*,doesntexist*,a,b}',
);
# and RCS files. Filter them out, and .pm files too.
unless (@a == 3
{
print "not ";
}
print "ok 8\n";
# "~" should expand to $ENV{HOME}
print "not ";
}
print "ok 9\n";