summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorToby Inkster <mail@tobyinkster.co.uk>2013-07-11 10:49:57 +0100
committerToby Inkster <mail@tobyinkster.co.uk>2013-07-11 10:49:57 +0100
commit6297a07c4d3216a6aa208859f2723cae6c633230 (patch)
tree0aaea70c24f0984411258f3c22fe6f5c604e14f0
parentb2e86fd5fd3ac9ad25c22b369e166e2657794ba2 (diff)
downloadexporter-lexical-6297a07c4d3216a6aa208859f2723cae6c633230.tar.gz
exporter-lexical-6297a07c4d3216a6aa208859f2723cae6c633230.zip
test that exported functions cross package boundaries like true lexical subs (this test already passes)
-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;