blob: dd95e980d550d44828581cd1236007a0c18d8f1b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
#!./perl
# $RCSfile: glob.t,v $$Revision: 4.1 $$Date: 92/08/07 18:27:55 $
print "1..6\n";
@oops = @ops = <op/*>;
map { $files{$_}++ } <op/*>;
if ($^O eq 'MSWin32') {
map { delete $files{"op/$_"} } split /[\s\n]/, `cmd /c "dir /b /l op"`;
}
else {
map { delete $files{$_} } split /[\s\n]/, `echo op/*`;
}
if (keys %files) {
print "not ok 1\t(",join(' ', sort keys %files),"\n";
} else { print "ok 1\n"; }
print $/ eq "\n" ? "ok 2\n" : "not ok 2\n";
while (<jskdfjskdfj* op/* jskdjfjkosvk*>) {
$not = "not " unless $_ eq shift @ops;
$not = "not at all " if $/ eq "\0";
}
print "${not}ok 3\n";
print $/ eq "\n" ? "ok 4\n" : "not ok 4\n";
# test the "glob" operator
$_ = "op/*";
@glops = glob $_;
print "@glops" eq "@oops" ? "ok 5\n" : "not ok 5\n";
@glops = glob;
print "@glops" eq "@oops" ? "ok 6\n" : "not ok 6\n";
|