]> git.vpit.fr Git - perl/modules/re-engine-Plugin.git/blob - t/10-usage/import.t
Switch to qw<>
[perl/modules/re-engine-Plugin.git] / t / 10-usage / import.t
1 use strict;
2 use lib 't/10-usage';
3 use Test::More skip_all => "Needs lameness in user code";
4
5 #    my $caller = caller;
6 #
7 # This won't work unless the subs are predeclared before the C<use> statement
8 #    # Handle import tags
9 #    if (@_ == 1) {
10 #        if ($_[0] ne ":import") {
11 #            require Carp;
12 #            Carp::croak("Unknown tag '$_[0]'");
13 #        }
14 #
15 #        # We have :import, generate import and unimport methods in the
16 #        # calling package
17 #        my %pkg;
18 #        for (qw<comp exec>) {
19 #            no strict 'refs';
20 #            $pkg{$_} = *{"$caller\::$_"}{CODE} if *{"$caller\::$_"}{CODE};
21 #        }
22 #
23 #        use Data::Dumper;
24 #        warn Dumper \%pkg;
25 #
26 #        no strict 'refs';
27 #        *{"$caller\::import"} = sub {
28 #            __PACKAGE__->import(%pkg);
29 #        };
30 #        *{"$caller\::unimport"} = \&unimport;
31 #
32 #        return;
33 #    }
34 #
35
36 use import;
37
38 "ook" =~ /pattern/;
39
40 is($1, "ook_1");