1#!./perl
2
3BEGIN {
4    chdir 't' if -d 't';
5    @INC = '../lib';
6    unless (defined &DynaLoader::boot_DynaLoader) {
7      print "1..0 # Skip: no dynamic loading on miniperl, no Tie::Hash::NamedCapture\n";
8      exit 0;
9    }
10}
11
12# WARNING: Do not directly use any modules as part of this test code.
13# We could get action at a distance that would invalidate the tests.
14
15print "1..2\n";
16
17# This tests whether glob assignment fails to load the tie.
18*X = *-;
19'X'=~/(?<X>X)/;
20print eval '*X{HASH}{X} || 1' ? "" :"not ","ok ",++$test,"\n";
21
22# And since it's a similar case we check %! as well. Note that
23# this can't be done until ../lib/Errno.pm is in place, as the
24# glob hits $!, which needs that module.
25*Y = *!;
26print 0<keys(%Y) ? "" :"not ","ok ",++$test,"\n";
27