Commit | Line | Data |
a687059c |
1 | #!./perl |
2 | |
79072805 |
3 | # $RCSfile: glob.t,v $$Revision: 4.1 $$Date: 92/08/07 18:27:55 $ |
a687059c |
4 | |
0a753a76 |
5 | print "1..6\n"; |
a687059c |
6 | |
0a753a76 |
7 | @oops = @ops = <op/*>; |
a687059c |
8 | |
68dc0745 |
9 | if ($^O eq 'MSWin32') { |
3cd616b9 |
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"`, |
68dc0745 |
12 | } |
13 | else { |
3cd616b9 |
14 | map { $files{$_}++ } <op/*>; |
68dc0745 |
15 | map { delete $files{$_} } split /[\s\n]/, `echo op/*`; |
16 | } |
adbc4883 |
17 | if (keys %files) { |
18 | print "not ok 1\t(",join(' ', sort keys %files),"\n"; |
19 | } else { print "ok 1\n"; } |
a687059c |
20 | |
21 | print $/ eq "\n" ? "ok 2\n" : "not ok 2\n"; |
22 | |
fe14fcc3 |
23 | while (<jskdfjskdfj* op/* jskdjfjkosvk*>) { |
a687059c |
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"; |
0a753a76 |
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"; |