summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2013-07-11 06:19:27 -0700
committerJesse Luehrs <doy@tozt.net>2013-07-11 06:19:27 -0700
commit7c17555866cf966c5667c43700861cca0245e651 (patch)
tree0aaea70c24f0984411258f3c22fe6f5c604e14f0
parentb2e86fd5fd3ac9ad25c22b369e166e2657794ba2 (diff)
parent6297a07c4d3216a6aa208859f2723cae6c633230 (diff)
downloadexporter-lexical-master.tar.gz
exporter-lexical-master.zip
Merge pull request #1 from tobyink/masterHEADmaster
Test that exported subs are truly lexical
-rw-r--r--t/cross-package.t18
1 files changed, 18 insertions, 0 deletions
diff --git a/t/cross-package.t b/t/cross-package.t
new file mode 100644
index 0000000..b62f041
--- /dev/null
+++ b/t/cross-package.t
@@ -0,0 +1,18 @@
+#!/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" }) }
+ package Forget::Me::Not;
+ ::is(foo(), "FOO");
+}
+is(foo(), "foo");
+
+done_testing;