summaryrefslogtreecommitdiffstats
path: root/t
diff options
context:
space:
mode:
Diffstat (limited to 't')
-rw-r--r--t/basic.t17
-rw-r--r--t/exporter.t16
-rw-r--r--t/lib/Foo.pm11
3 files changed, 44 insertions, 0 deletions
diff --git a/t/basic.t b/t/basic.t
new file mode 100644
index 0000000..f7321e9
--- /dev/null
+++ b/t/basic.t
@@ -0,0 +1,17 @@
+#!/usr/bin/env perl
+use strict;
+use warnings;
+use Test::More;
+
+use Exporter::Lexical ();
+
+sub foo { 'foo' }
+
+is(foo(), "foo");
+{
+ BEGIN { Exporter::Lexical::lexical_import(foo => sub { "FOO" }) }
+ is(foo(), "FOO");
+}
+is(foo(), "foo");
+
+done_testing;
diff --git a/t/exporter.t b/t/exporter.t
new file mode 100644
index 0000000..da39d6a
--- /dev/null
+++ b/t/exporter.t
@@ -0,0 +1,16 @@
+#!/usr/bin/env perl
+use strict;
+use warnings;
+use Test::More;
+use lib 't/lib';
+
+sub foo { 'foo' }
+
+is(foo(), "foo");
+{
+ use Foo;
+ is(foo(), "FOO");
+}
+is(foo(), "foo");
+
+done_testing;
diff --git a/t/lib/Foo.pm b/t/lib/Foo.pm
new file mode 100644
index 0000000..14521ad
--- /dev/null
+++ b/t/lib/Foo.pm
@@ -0,0 +1,11 @@
+package Foo;
+use strict;
+use warnings;
+
+use Exporter::Lexical;
+
+our @EXPORT = ('foo');
+
+sub foo { "FOO" }
+
+1;