File: 50-autoloaderfix.t

package info (click to toggle)
libpar-perl 1.000-1%2Bsqueeze1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 464 kB
  • ctags: 265
  • sloc: perl: 3,529; makefile: 4
file content (29 lines) | stat: -rw-r--r-- 615 bytes parent folder | download | duplicates (8)
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
#!/usr/bin/perl
# Problem doesn't manifest if Test::More is in effect?
# What the hell?

use File::Temp ();
BEGIN { $ENV{PAR_TMPDIR} = File::Temp::tempdir(TMPDIR => 1, CLEANUP => 1); }

$|=1;
print "1..1\n";
use PAR;

package Bar;
use AutoLoader 'AUTOLOAD';
# Can't use strict and warnings because in case of the
# erroneous recursion, we'll require ourselves and get a
# "subroutine redefined" error which doesn't matter.
sub new {
    return bless {} => $_[0];
}

package main;

$INC{"Bar"} = $0; # <--
{
    my $p = Bar->new();
} # <-- looping while looking for Bar::DESTROY

print "ok 1 - AutoLoader works\n";