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 | |
adbc4883 |
9 | map { $files{$_}++ } <op/*>; |
68dc0745 |
10 | if ($^O eq 'MSWin32') { |
11 | map { delete $files{"op/$_"} } split /[\s\n]/, `cmd /c "dir /b /l op"`; |
12 | } |
13 | else { |
14 | map { delete $files{$_} } split /[\s\n]/, `echo op/*`; |
15 | } |
adbc4883 |
16 | if (keys %files) { |
17 | print "not ok 1\t(",join(' ', sort keys %files),"\n"; |
18 | } else { print "ok 1\n"; } |
a687059c |
19 | |
20 | print $/ eq "\n" ? "ok 2\n" : "not ok 2\n"; |
21 | |
fe14fcc3 |
22 | while (<jskdfjskdfj* op/* jskdjfjkosvk*>) { |
a687059c |
23 | $not = "not " unless $_ eq shift @ops; |
24 | $not = "not at all " if $/ eq "\0"; |
25 | } |
26 | print "${not}ok 3\n"; |
27 | |
28 | print $/ eq "\n" ? "ok 4\n" : "not ok 4\n"; |
0a753a76 |
29 | |
30 | # test the "glob" operator |
31 | $_ = "op/*"; |
32 | @glops = glob $_; |
33 | print "@glops" eq "@oops" ? "ok 5\n" : "not ok 5\n"; |
34 | |
35 | @glops = glob; |
36 | print "@glops" eq "@oops" ? "ok 6\n" : "not ok 6\n"; |