summaryrefslogtreecommitdiffstats
path: root/t
diff options
context:
space:
mode:
Diffstat (limited to 't')
-rw-r--r--t/build_exporter.t17
-rw-r--r--t/lib/Bar.pm20
2 files changed, 37 insertions, 0 deletions
diff --git a/t/build_exporter.t b/t/build_exporter.t
new file mode 100644
index 0000000..621e2aa
--- /dev/null
+++ b/t/build_exporter.t
@@ -0,0 +1,17 @@
+#!/usr/bin/env perl
+use strict;
+use warnings;
+use Test::More;
+use lib 't/lib';
+
+sub bar { 'bar' }
+
+is(bar(), "bar");
+{
+ use Bar;
+ is(bar(), "BAR");
+ is($Bar::imported, 1);
+}
+is(bar(), "bar");
+
+done_testing;
diff --git a/t/lib/Bar.pm b/t/lib/Bar.pm
new file mode 100644
index 0000000..69aadf9
--- /dev/null
+++ b/t/lib/Bar.pm
@@ -0,0 +1,20 @@
+package Bar;
+use strict;
+use warnings;
+
+use Exporter::Lexical ();
+
+our $imported;
+
+my $import = Exporter::Lexical::build_exporter({
+ -exports => [ qw(bar) ],
+});
+
+sub import {
+ $imported = 1;
+ goto $import;
+}
+
+sub bar { "BAR" }
+
+1;