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