xref: /onnv-gate/usr/src/cmd/perl/5.8.4/distrib/lib/AutoSplit.t (revision 0:68f95e015346)
1*0Sstevel@tonic-gate#!./perl -w
2*0Sstevel@tonic-gate
3*0Sstevel@tonic-gate# AutoLoader.t runs before this test, so it seems safe to assume that it will
4*0Sstevel@tonic-gate# work.
5*0Sstevel@tonic-gate
6*0Sstevel@tonic-gatemy($incdir, $lib);
7*0Sstevel@tonic-gateBEGIN {
8*0Sstevel@tonic-gate    chdir 't' if -d 't';
9*0Sstevel@tonic-gate    if ($^O eq 'dos') {
10*0Sstevel@tonic-gate	print "1..0 # This test is not 8.3-aware.\n";
11*0Sstevel@tonic-gate	    exit 0;
12*0Sstevel@tonic-gate    }
13*0Sstevel@tonic-gate    if ($^O eq 'MacOS') {
14*0Sstevel@tonic-gate	$incdir = ":auto-$$";
15*0Sstevel@tonic-gate        $lib = '-I::lib:';
16*0Sstevel@tonic-gate    } else {
17*0Sstevel@tonic-gate	$incdir = "auto-$$";
18*0Sstevel@tonic-gate	$lib = '"-I../lib"'; # ok on unix, nt, The extra \" are for VMS
19*0Sstevel@tonic-gate    }
20*0Sstevel@tonic-gate    @INC = $incdir;
21*0Sstevel@tonic-gate    push @INC, '../lib';
22*0Sstevel@tonic-gate}
23*0Sstevel@tonic-gatemy $runperl = "$^X $lib";
24*0Sstevel@tonic-gate
25*0Sstevel@tonic-gateuse warnings;
26*0Sstevel@tonic-gateuse strict;
27*0Sstevel@tonic-gateuse Test::More tests => 58;
28*0Sstevel@tonic-gateuse File::Spec;
29*0Sstevel@tonic-gateuse File::Find;
30*0Sstevel@tonic-gate
31*0Sstevel@tonic-gaterequire AutoSplit; # Run time. Check it compiles.
32*0Sstevel@tonic-gateok (1, "AutoSplit loaded");
33*0Sstevel@tonic-gate
34*0Sstevel@tonic-gateEND {
35*0Sstevel@tonic-gate    use File::Path;
36*0Sstevel@tonic-gate    print "# $incdir being removed...\n";
37*0Sstevel@tonic-gate    rmtree($incdir);
38*0Sstevel@tonic-gate}
39*0Sstevel@tonic-gate
40*0Sstevel@tonic-gatemkdir $incdir,0755;
41*0Sstevel@tonic-gate
42*0Sstevel@tonic-gatemy @tests;
43*0Sstevel@tonic-gate{
44*0Sstevel@tonic-gate  # local this else it buggers up the chomp() below.
45*0Sstevel@tonic-gate  # Hmm. Would be nice to have this as a regexp.
46*0Sstevel@tonic-gate  local $/
47*0Sstevel@tonic-gate    = "################################################################\n";
48*0Sstevel@tonic-gate  @tests = <DATA>;
49*0Sstevel@tonic-gate  close DATA;
50*0Sstevel@tonic-gate}
51*0Sstevel@tonic-gate
52*0Sstevel@tonic-gatemy $pathsep = $^O eq 'MSWin32' ? '\\' : $^O eq 'MacOS' ? ':' : '/';
53*0Sstevel@tonic-gatemy $endpathsep = $^O eq 'MacOS' ? ':' : '';
54*0Sstevel@tonic-gate
55*0Sstevel@tonic-gatesub split_a_file {
56*0Sstevel@tonic-gate  my $contents = shift;
57*0Sstevel@tonic-gate  my $file = $_[0];
58*0Sstevel@tonic-gate  if (defined $contents) {
59*0Sstevel@tonic-gate    open FILE, ">$file" or die "Can't open $file: $!";
60*0Sstevel@tonic-gate    print FILE $contents;
61*0Sstevel@tonic-gate    close FILE or die "Can't close $file: $!";
62*0Sstevel@tonic-gate  }
63*0Sstevel@tonic-gate
64*0Sstevel@tonic-gate  # Assumption: no characters in arguments need escaping from the shell or perl
65*0Sstevel@tonic-gate  my $com = qq($runperl -e "use AutoSplit; autosplit (qw(@_))");
66*0Sstevel@tonic-gate  print "# command: $com\n";
67*0Sstevel@tonic-gate  # There may be a way to capture STDOUT without spawning a child process, but
68*0Sstevel@tonic-gate  # it's probably worthwhile spawning, as it ensures that nothing in AutoSplit
69*0Sstevel@tonic-gate  # can load functions from split modules into this perl.
70*0Sstevel@tonic-gate  my $output = `$com`;
71*0Sstevel@tonic-gate  warn "Exit status $? from running: >>$com<<" if $?;
72*0Sstevel@tonic-gate  return $output;
73*0Sstevel@tonic-gate}
74*0Sstevel@tonic-gate
75*0Sstevel@tonic-gatemy $i = 0;
76*0Sstevel@tonic-gatemy $dir = File::Spec->catdir($incdir, 'auto');
77*0Sstevel@tonic-gateif ($^O eq 'VMS') {
78*0Sstevel@tonic-gate  $dir = VMS::Filespec::unixify($dir);
79*0Sstevel@tonic-gate  $dir =~ s/\/$//;
80*0Sstevel@tonic-gate} elsif ($^O eq 'MacOS') {
81*0Sstevel@tonic-gate  $dir =~ s/:$//;
82*0Sstevel@tonic-gate}
83*0Sstevel@tonic-gate
84*0Sstevel@tonic-gateforeach (@tests) {
85*0Sstevel@tonic-gate  my $module = 'A' . $i . '_' . $$ . 'splittest';
86*0Sstevel@tonic-gate  my $file = File::Spec->catfile($incdir,"$module.pm");
87*0Sstevel@tonic-gate  s/\*INC\*/$incdir/gm;
88*0Sstevel@tonic-gate  s/\*DIR\*/$dir/gm;
89*0Sstevel@tonic-gate  s/\*MOD\*/$module/gm;
90*0Sstevel@tonic-gate  s/\*PATHSEP\*/$pathsep/gm;
91*0Sstevel@tonic-gate  s/\*ENDPATHSEP\*/$endpathsep/gm;
92*0Sstevel@tonic-gate  s#//#/#gm;
93*0Sstevel@tonic-gate  # Build a hash for this test.
94*0Sstevel@tonic-gate  my %args = /^\#\#\ ([^\n]*)\n	# Key is on a line starting ##
95*0Sstevel@tonic-gate             ((?:[^\#]+		# Any number of characters not #
96*0Sstevel@tonic-gate               | \#(?!\#)	# or a # character not followed by #
97*0Sstevel@tonic-gate               | (?<!\n)\#	# or a # character not preceded by \n
98*0Sstevel@tonic-gate              )*)/sgmx;
99*0Sstevel@tonic-gate  foreach ($args{Name}, $args{Require}, $args{Extra}) {
100*0Sstevel@tonic-gate    chomp $_ if defined $_;
101*0Sstevel@tonic-gate  }
102*0Sstevel@tonic-gate  my @extra_args = !defined $args{Extra} ? () : split /,/, $args{Extra};
103*0Sstevel@tonic-gate  my ($output, $body);
104*0Sstevel@tonic-gate  if ($args{File}) {
105*0Sstevel@tonic-gate    $body ="package $module;\n" . $args{File};
106*0Sstevel@tonic-gate    $output = split_a_file ($body, $file, $dir, @extra_args);
107*0Sstevel@tonic-gate  } else {
108*0Sstevel@tonic-gate    # Repeat tests
109*0Sstevel@tonic-gate    $output = split_a_file (undef, $file, $dir, @extra_args);
110*0Sstevel@tonic-gate  }
111*0Sstevel@tonic-gate
112*0Sstevel@tonic-gate  if ($^O eq 'VMS') {
113*0Sstevel@tonic-gate     my ($filespec, $replacement);
114*0Sstevel@tonic-gate     while ($output =~ m/(\[.+\])/) {
115*0Sstevel@tonic-gate       $filespec = $1;
116*0Sstevel@tonic-gate       $replacement =  VMS::Filespec::unixify($filespec);
117*0Sstevel@tonic-gate       $replacement =~ s/\/$//;
118*0Sstevel@tonic-gate       $output =~ s/\Q$filespec\E/$replacement/;
119*0Sstevel@tonic-gate     }
120*0Sstevel@tonic-gate  }
121*0Sstevel@tonic-gate
122*0Sstevel@tonic-gate  # test n+1
123*0Sstevel@tonic-gate  cmp_ok ($output, 'eq', $args{Get}, "Output from autosplit()ing $args{Name}");
124*0Sstevel@tonic-gate
125*0Sstevel@tonic-gate  if ($args{Files}) {
126*0Sstevel@tonic-gate    $args{Files} =~ s!/!:!gs if $^O eq 'MacOS';
127*0Sstevel@tonic-gate    my (%missing, %got);
128*0Sstevel@tonic-gate    find (sub {$got{$File::Find::name}++ unless -d $_}, $dir);
129*0Sstevel@tonic-gate    foreach (split /\n/, $args{Files}) {
130*0Sstevel@tonic-gate      next if /^#/;
131*0Sstevel@tonic-gate      $_ = lc($_) if $^O eq 'VMS';
132*0Sstevel@tonic-gate      unless (delete $got{$_}) {
133*0Sstevel@tonic-gate        $missing{$_}++;
134*0Sstevel@tonic-gate      }
135*0Sstevel@tonic-gate    }
136*0Sstevel@tonic-gate    my @missing = keys %missing;
137*0Sstevel@tonic-gate    # test n+2
138*0Sstevel@tonic-gate    unless (ok (!@missing, "Are any expected files missing?")) {
139*0Sstevel@tonic-gate      print "# These files are missing\n";
140*0Sstevel@tonic-gate      print "# $_\n" foreach sort @missing;
141*0Sstevel@tonic-gate    }
142*0Sstevel@tonic-gate    my @extra = keys %got;
143*0Sstevel@tonic-gate    # test n+3
144*0Sstevel@tonic-gate    unless (ok (!@extra, "Are any extra files present?")) {
145*0Sstevel@tonic-gate      print "# These files are unexpectedly present:\n";
146*0Sstevel@tonic-gate      print "# $_\n" foreach sort @extra;
147*0Sstevel@tonic-gate    }
148*0Sstevel@tonic-gate  }
149*0Sstevel@tonic-gate  if ($args{Require}) {
150*0Sstevel@tonic-gate    $args{Require} =~ s|/|:|gm if $^O eq 'MacOS';
151*0Sstevel@tonic-gate    my $com = 'require "' . File::Spec->catfile ('auto', $args{Require}) . '"';
152*0Sstevel@tonic-gate    $com =~ s{\\}{/}gm if ($^O eq 'MSWin32');
153*0Sstevel@tonic-gate    eval $com;
154*0Sstevel@tonic-gate    # test n+3
155*0Sstevel@tonic-gate    ok ($@ eq '', $com) or print "# \$\@ = '$@'\n";
156*0Sstevel@tonic-gate    if (defined $body) {
157*0Sstevel@tonic-gate      eval $body or die $@;
158*0Sstevel@tonic-gate    }
159*0Sstevel@tonic-gate  }
160*0Sstevel@tonic-gate  # match tests to check for prototypes
161*0Sstevel@tonic-gate  if ($args{Match}) {
162*0Sstevel@tonic-gate    local $/;
163*0Sstevel@tonic-gate    my $file = File::Spec->catfile($dir, $args{Require});
164*0Sstevel@tonic-gate    open IX, $file or die "Can't open '$file': $!";
165*0Sstevel@tonic-gate    my $ix = <IX>;
166*0Sstevel@tonic-gate    close IX or die "Can't close '$file': $!";
167*0Sstevel@tonic-gate    foreach my $pat (split /\n/, $args{Match}) {
168*0Sstevel@tonic-gate      next if $pat =~ /^\#/;
169*0Sstevel@tonic-gate      like ($ix, qr/^\s*$pat\s*$/m, "match $pat");
170*0Sstevel@tonic-gate    }
171*0Sstevel@tonic-gate  }
172*0Sstevel@tonic-gate  # code tests contain eval{}ed ok()s etc
173*0Sstevel@tonic-gate  if ($args{Tests}) {
174*0Sstevel@tonic-gate    foreach my $code (split /\n/, $args{Tests}) {
175*0Sstevel@tonic-gate      next if $code =~ /^\#/;
176*0Sstevel@tonic-gate      defined eval $code or fail(), print "# Code:  $code\n# Error: $@";
177*0Sstevel@tonic-gate    }
178*0Sstevel@tonic-gate  }
179*0Sstevel@tonic-gate  if (my $sleepfor = $args{Sleep}) {
180*0Sstevel@tonic-gate    # We need to sleep for a while
181*0Sstevel@tonic-gate    # Need the sleep hack else the next test is so fast that the timestamp
182*0Sstevel@tonic-gate    # compare routine in AutoSplit thinks that it shouldn't split the files.
183*0Sstevel@tonic-gate    my $time = time;
184*0Sstevel@tonic-gate    my $until = $time + $sleepfor;
185*0Sstevel@tonic-gate    my $attempts = 3;
186*0Sstevel@tonic-gate    do {
187*0Sstevel@tonic-gate      sleep ($sleepfor)
188*0Sstevel@tonic-gate    } while (time < $until && --$attempts > 0);
189*0Sstevel@tonic-gate    if ($attempts == 0) {
190*0Sstevel@tonic-gate      printf << "EOM", time;
191*0Sstevel@tonic-gate# Attempted to sleep for $sleepfor second(s), started at $time, now %d.
192*0Sstevel@tonic-gate# sleep attempt ppears to have failed; some tests may fail as a result.
193*0Sstevel@tonic-gateEOM
194*0Sstevel@tonic-gate    }
195*0Sstevel@tonic-gate  }
196*0Sstevel@tonic-gate  unless ($args{SameAgain}) {
197*0Sstevel@tonic-gate    $i++;
198*0Sstevel@tonic-gate    rmtree($dir);
199*0Sstevel@tonic-gate    mkdir $dir, 0775;
200*0Sstevel@tonic-gate  }
201*0Sstevel@tonic-gate}
202*0Sstevel@tonic-gate
203*0Sstevel@tonic-gate__DATA__
204*0Sstevel@tonic-gate## Name
205*0Sstevel@tonic-gatetests from the end of the AutoSplit module.
206*0Sstevel@tonic-gate## File
207*0Sstevel@tonic-gateuse AutoLoader 'AUTOLOAD';
208*0Sstevel@tonic-gate{package Just::Another;
209*0Sstevel@tonic-gate use AutoLoader 'AUTOLOAD';
210*0Sstevel@tonic-gate}
211*0Sstevel@tonic-gate@Yet::Another::AutoSplit::ISA = 'AutoLoader';
212*0Sstevel@tonic-gate1;
213*0Sstevel@tonic-gate__END__
214*0Sstevel@tonic-gatesub test1 ($)   { "test 1"; }
215*0Sstevel@tonic-gatesub test2 ($$)  { "test 2"; }
216*0Sstevel@tonic-gatesub test3 ($$$) { "test 3"; }
217*0Sstevel@tonic-gatesub testtesttesttest4_1  { "test 4"; }
218*0Sstevel@tonic-gatesub testtesttesttest4_2  { "duplicate test 4"; }
219*0Sstevel@tonic-gatesub Just::Another::test5 { "another test 5"; }
220*0Sstevel@tonic-gatesub test6       { return join ":", __FILE__,__LINE__; }
221*0Sstevel@tonic-gatepackage Yet::Another::AutoSplit;
222*0Sstevel@tonic-gatesub testtesttesttest4_1 ($)  { "another test 4"; }
223*0Sstevel@tonic-gatesub testtesttesttest4_2 ($$) { "another duplicate test 4"; }
224*0Sstevel@tonic-gatepackage Yet::More::Attributes;
225*0Sstevel@tonic-gatesub test_a1 ($) : locked :locked { 1; }
226*0Sstevel@tonic-gatesub test_a2 : locked { 1; }
227*0Sstevel@tonic-gate# And that was all it has. You were expected to manually inspect the output
228*0Sstevel@tonic-gate## Get
229*0Sstevel@tonic-gateWarning: AutoSplit had to create top-level *DIR* unexpectedly.
230*0Sstevel@tonic-gateAutoSplitting *INC**PATHSEP**MOD*.pm (*DIR**PATHSEP**MOD**ENDPATHSEP*)
231*0Sstevel@tonic-gate*INC**PATHSEP**MOD*.pm: some names are not unique when truncated to 8 characters:
232*0Sstevel@tonic-gate directory *DIR**PATHSEP**MOD**ENDPATHSEP*:
233*0Sstevel@tonic-gate  testtesttesttest4_1.al, testtesttesttest4_2.al truncate to testtest
234*0Sstevel@tonic-gate directory *DIR**PATHSEP*Yet*PATHSEP*Another*PATHSEP*AutoSplit*ENDPATHSEP*:
235*0Sstevel@tonic-gate  testtesttesttest4_1.al, testtesttesttest4_2.al truncate to testtest
236*0Sstevel@tonic-gate## Files
237*0Sstevel@tonic-gate*DIR*/*MOD*/autosplit.ix
238*0Sstevel@tonic-gate*DIR*/*MOD*/test1.al
239*0Sstevel@tonic-gate*DIR*/*MOD*/test2.al
240*0Sstevel@tonic-gate*DIR*/*MOD*/test3.al
241*0Sstevel@tonic-gate*DIR*/*MOD*/testtesttesttest4_1.al
242*0Sstevel@tonic-gate*DIR*/*MOD*/testtesttesttest4_2.al
243*0Sstevel@tonic-gate*DIR*/Just/Another/test5.al
244*0Sstevel@tonic-gate*DIR*/*MOD*/test6.al
245*0Sstevel@tonic-gate*DIR*/Yet/Another/AutoSplit/testtesttesttest4_1.al
246*0Sstevel@tonic-gate*DIR*/Yet/Another/AutoSplit/testtesttesttest4_2.al
247*0Sstevel@tonic-gate*DIR*/Yet/More/Attributes/test_a1.al
248*0Sstevel@tonic-gate*DIR*/Yet/More/Attributes/test_a2.al
249*0Sstevel@tonic-gate## Require
250*0Sstevel@tonic-gate*MOD*/autosplit.ix
251*0Sstevel@tonic-gate## Match
252*0Sstevel@tonic-gate# Need to find these lines somewhere in the required file
253*0Sstevel@tonic-gatesub test1\s*\(\$\);
254*0Sstevel@tonic-gatesub test2\s*\(\$\$\);
255*0Sstevel@tonic-gatesub test3\s*\(\$\$\$\);
256*0Sstevel@tonic-gatesub testtesttesttest4_1\s*\(\$\);
257*0Sstevel@tonic-gatesub testtesttesttest4_2\s*\(\$\$\);
258*0Sstevel@tonic-gatesub test_a1\s*\(\$\)\s*:\s*locked\s*:\s*locked\s*;
259*0Sstevel@tonic-gatesub test_a2\s*:\s*locked\s*;
260*0Sstevel@tonic-gate## Tests
261*0Sstevel@tonic-gateis (*MOD*::test1 (1), 'test 1');
262*0Sstevel@tonic-gateis (*MOD*::test2 (1,2), 'test 2');
263*0Sstevel@tonic-gateis (*MOD*::test3 (1,2,3), 'test 3');
264*0Sstevel@tonic-gateok (!defined eval "*MOD*::test1 () eq 'test 1'" and $@ =~ /^Not enough arguments for *MOD*::test1/, "Check prototypes mismatch fails") or print "# \$\@='$@'";
265*0Sstevel@tonic-gateis (&*MOD*::testtesttesttest4_1, "test 4");
266*0Sstevel@tonic-gateis (&*MOD*::testtesttesttest4_2, "duplicate test 4");
267*0Sstevel@tonic-gateis (&Just::Another::test5, "another test 5");
268*0Sstevel@tonic-gate# very messy way to interpolate function into regexp, but it's going to be
269*0Sstevel@tonic-gate# needed to get : for Mac filespecs
270*0Sstevel@tonic-gatelike (&*MOD*::test6, qr!^\Q*INC**PATHSEP**MOD*\E\.pm \(autosplit into \Q@{[File::Spec->catfile('*DIR*','*MOD*', 'test6.al')]}\E\):\d+$!);
271*0Sstevel@tonic-gateok (Yet::Another::AutoSplit->testtesttesttest4_1 eq "another test 4");
272*0Sstevel@tonic-gate################################################################
273*0Sstevel@tonic-gate## Name
274*0Sstevel@tonic-gatemissing use AutoLoader;
275*0Sstevel@tonic-gate## File
276*0Sstevel@tonic-gate1;
277*0Sstevel@tonic-gate__END__
278*0Sstevel@tonic-gate## Get
279*0Sstevel@tonic-gate## Files
280*0Sstevel@tonic-gate# There should be no files.
281*0Sstevel@tonic-gate################################################################
282*0Sstevel@tonic-gate## Name
283*0Sstevel@tonic-gatemissing use AutoLoader; (but don't skip)
284*0Sstevel@tonic-gate## Extra
285*0Sstevel@tonic-gate0, 0
286*0Sstevel@tonic-gate## File
287*0Sstevel@tonic-gate1;
288*0Sstevel@tonic-gate__END__
289*0Sstevel@tonic-gate## Get
290*0Sstevel@tonic-gateAutoSplitting *INC**PATHSEP**MOD*.pm (*DIR**PATHSEP**MOD**ENDPATHSEP*)
291*0Sstevel@tonic-gate## Require
292*0Sstevel@tonic-gate*MOD*/autosplit.ix
293*0Sstevel@tonic-gate## Files
294*0Sstevel@tonic-gate*DIR*/*MOD*/autosplit.ix
295*0Sstevel@tonic-gate################################################################
296*0Sstevel@tonic-gate## Name
297*0Sstevel@tonic-gateSplit prior to checking whether obsolete files get deleted
298*0Sstevel@tonic-gate## File
299*0Sstevel@tonic-gateuse AutoLoader 'AUTOLOAD';
300*0Sstevel@tonic-gate1;
301*0Sstevel@tonic-gate__END__
302*0Sstevel@tonic-gatesub obsolete {our $hidden_a; return $hidden_a++;}
303*0Sstevel@tonic-gatesub gonner {warn "This gonner function should never get called"}
304*0Sstevel@tonic-gate## Get
305*0Sstevel@tonic-gateAutoSplitting *INC**PATHSEP**MOD*.pm (*DIR**PATHSEP**MOD**ENDPATHSEP*)
306*0Sstevel@tonic-gate## Require
307*0Sstevel@tonic-gate*MOD*/autosplit.ix
308*0Sstevel@tonic-gate## Files
309*0Sstevel@tonic-gate*DIR*/*MOD*/autosplit.ix
310*0Sstevel@tonic-gate*DIR*/*MOD*/gonner.al
311*0Sstevel@tonic-gate*DIR*/*MOD*/obsolete.al
312*0Sstevel@tonic-gate## Tests
313*0Sstevel@tonic-gateis (&*MOD*::obsolete, 0);
314*0Sstevel@tonic-gateis (&*MOD*::obsolete, 1);
315*0Sstevel@tonic-gate## Sleep
316*0Sstevel@tonic-gate4
317*0Sstevel@tonic-gate## SameAgain
318*0Sstevel@tonic-gateTrue, so don't scrub this directory.
319*0Sstevel@tonic-gateIIRC DOS FAT filesystems have only 2 second granularity.
320*0Sstevel@tonic-gate################################################################
321*0Sstevel@tonic-gate## Name
322*0Sstevel@tonic-gateCheck whether obsolete files get deleted
323*0Sstevel@tonic-gate## File
324*0Sstevel@tonic-gateuse AutoLoader 'AUTOLOAD';
325*0Sstevel@tonic-gate1;
326*0Sstevel@tonic-gate__END__
327*0Sstevel@tonic-gatesub skeleton {"bones"};
328*0Sstevel@tonic-gatesub ghost {"scream"}; # This definition gets overwritten with the one below
329*0Sstevel@tonic-gatesub ghoul {"wail"};
330*0Sstevel@tonic-gatesub zombie {"You didn't use fire."};
331*0Sstevel@tonic-gatesub flying_pig {"Oink oink flap flap"};
332*0Sstevel@tonic-gate## Get
333*0Sstevel@tonic-gateAutoSplitting *INC**PATHSEP**MOD*.pm (*DIR**PATHSEP**MOD**ENDPATHSEP*)
334*0Sstevel@tonic-gate## Require
335*0Sstevel@tonic-gate*MOD*/autosplit.ix
336*0Sstevel@tonic-gate## Files
337*0Sstevel@tonic-gate*DIR*/*MOD*/autosplit.ix
338*0Sstevel@tonic-gate*DIR*/*MOD*/skeleton.al
339*0Sstevel@tonic-gate*DIR*/*MOD*/zombie.al
340*0Sstevel@tonic-gate*DIR*/*MOD*/ghost.al
341*0Sstevel@tonic-gate*DIR*/*MOD*/ghoul.al
342*0Sstevel@tonic-gate*DIR*/*MOD*/flying_pig.al
343*0Sstevel@tonic-gate## Tests
344*0Sstevel@tonic-gateis (&*MOD*::skeleton, "bones", "skeleton");
345*0Sstevel@tonic-gateeval {&*MOD*::gonner}; ok ($@ =~ m!^Can't locate auto/*MOD*/gonner.al in \@INC!, "Check &*MOD*::gonner is now a gonner") or print "# \$\@='$@'\n";
346*0Sstevel@tonic-gate## Sleep
347*0Sstevel@tonic-gate4
348*0Sstevel@tonic-gate## SameAgain
349*0Sstevel@tonic-gateTrue, so don't scrub this directory.
350*0Sstevel@tonic-gate################################################################
351*0Sstevel@tonic-gate## Name
352*0Sstevel@tonic-gateCheck whether obsolete files remain when keep is 1
353*0Sstevel@tonic-gate## Extra
354*0Sstevel@tonic-gate1, 1
355*0Sstevel@tonic-gate## File
356*0Sstevel@tonic-gateuse AutoLoader 'AUTOLOAD';
357*0Sstevel@tonic-gate1;
358*0Sstevel@tonic-gate__END__
359*0Sstevel@tonic-gatesub ghost {"bump"};
360*0Sstevel@tonic-gatesub wraith {9};
361*0Sstevel@tonic-gate## Get
362*0Sstevel@tonic-gateAutoSplitting *INC**PATHSEP**MOD*.pm (*DIR**PATHSEP**MOD**ENDPATHSEP*)
363*0Sstevel@tonic-gate## Require
364*0Sstevel@tonic-gate*MOD*/autosplit.ix
365*0Sstevel@tonic-gate## Files
366*0Sstevel@tonic-gate*DIR*/*MOD*/autosplit.ix
367*0Sstevel@tonic-gate*DIR*/*MOD*/skeleton.al
368*0Sstevel@tonic-gate*DIR*/*MOD*/zombie.al
369*0Sstevel@tonic-gate*DIR*/*MOD*/ghost.al
370*0Sstevel@tonic-gate*DIR*/*MOD*/ghoul.al
371*0Sstevel@tonic-gate*DIR*/*MOD*/wraith.al
372*0Sstevel@tonic-gate*DIR*/*MOD*/flying_pig.al
373*0Sstevel@tonic-gate## Tests
374*0Sstevel@tonic-gateis (&*MOD*::ghost, "bump");
375*0Sstevel@tonic-gateis (&*MOD*::zombie, "You didn't use fire.", "Are our zombies undead?");
376*0Sstevel@tonic-gate## Sleep
377*0Sstevel@tonic-gate4
378*0Sstevel@tonic-gate## SameAgain
379*0Sstevel@tonic-gateTrue, so don't scrub this directory.
380*0Sstevel@tonic-gate################################################################
381*0Sstevel@tonic-gate## Name
382*0Sstevel@tonic-gateWithout the timestamp check make sure that nothing happens
383*0Sstevel@tonic-gate## Extra
384*0Sstevel@tonic-gate0, 1, 1
385*0Sstevel@tonic-gate## Require
386*0Sstevel@tonic-gate*MOD*/autosplit.ix
387*0Sstevel@tonic-gate## Files
388*0Sstevel@tonic-gate*DIR*/*MOD*/autosplit.ix
389*0Sstevel@tonic-gate*DIR*/*MOD*/skeleton.al
390*0Sstevel@tonic-gate*DIR*/*MOD*/zombie.al
391*0Sstevel@tonic-gate*DIR*/*MOD*/ghost.al
392*0Sstevel@tonic-gate*DIR*/*MOD*/ghoul.al
393*0Sstevel@tonic-gate*DIR*/*MOD*/wraith.al
394*0Sstevel@tonic-gate*DIR*/*MOD*/flying_pig.al
395*0Sstevel@tonic-gate## Tests
396*0Sstevel@tonic-gateis (&*MOD*::ghoul, "wail", "still haunted");
397*0Sstevel@tonic-gateis (&*MOD*::zombie, "You didn't use fire.", "Are our zombies still undead?");
398*0Sstevel@tonic-gate## Sleep
399*0Sstevel@tonic-gate4
400*0Sstevel@tonic-gate## SameAgain
401*0Sstevel@tonic-gateTrue, so don't scrub this directory.
402*0Sstevel@tonic-gate################################################################
403*0Sstevel@tonic-gate## Name
404*0Sstevel@tonic-gateWith the timestamp check make sure that things happen (stuff gets deleted)
405*0Sstevel@tonic-gate## Extra
406*0Sstevel@tonic-gate0, 1, 0
407*0Sstevel@tonic-gate## Get
408*0Sstevel@tonic-gateAutoSplitting *INC**PATHSEP**MOD*.pm (*DIR**PATHSEP**MOD**ENDPATHSEP*)
409*0Sstevel@tonic-gate## Require
410*0Sstevel@tonic-gate*MOD*/autosplit.ix
411*0Sstevel@tonic-gate## Files
412*0Sstevel@tonic-gate*DIR*/*MOD*/autosplit.ix
413*0Sstevel@tonic-gate*DIR*/*MOD*/ghost.al
414*0Sstevel@tonic-gate*DIR*/*MOD*/wraith.al
415*0Sstevel@tonic-gate## Tests
416*0Sstevel@tonic-gateis (&*MOD*::wraith, 9);
417*0Sstevel@tonic-gateeval {&*MOD*::flying_pig}; ok ($@ =~ m!^Can't locate auto/*MOD*/flying_pig.al in \@INC!, "There are no flying pigs") or print "# \$\@='$@'\n";
418