]> git.vpit.fr Git - perl/modules/re-engine-Plugin.git/blobdiff - t/10-usage/import.t
Order the test subdirectories
[perl/modules/re-engine-Plugin.git] / t / 10-usage / import.t
diff --git a/t/10-usage/import.t b/t/10-usage/import.t
new file mode 100644 (file)
index 0000000..40aad43
--- /dev/null
@@ -0,0 +1,40 @@
+use strict;
+use lib 't/usage';
+use Test::More skip_all => "Needs lameness in user code";
+
+#    my $caller = caller;
+#
+# This won't work unless the subs are predeclared before the C<use> statement
+#    # Handle import tags
+#    if (@_ == 1) {
+#        if ($_[0] ne ":import") {
+#            require Carp;
+#            Carp::croak("Unknown tag '$_[0]'");
+#        }
+#
+#        # We have :import, generate import and unimport methods in the
+#        # calling package
+#        my %pkg;
+#        for (qw(comp exec)) {
+#            no strict 'refs';
+#            $pkg{$_} = *{"$caller\::$_"}{CODE} if *{"$caller\::$_"}{CODE};
+#        }
+#
+#        use Data::Dumper;
+#        warn Dumper \%pkg;
+#
+#        no strict 'refs';
+#        *{"$caller\::import"} = sub {
+#            __PACKAGE__->import(%pkg);
+#        };
+#        *{"$caller\::unimport"} = \&unimport;
+#
+#        return;
+#    }
+#
+
+use import;
+
+"ook" =~ /pattern/;
+
+is($1, "ook_1");