From 6297a07c4d3216a6aa208859f2723cae6c633230 Mon Sep 17 00:00:00 2001 From: Toby Inkster Date: Thu, 11 Jul 2013 10:49:57 +0100 Subject: test that exported functions cross package boundaries like true lexical subs (this test already passes) --- t/cross-package.t | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 t/cross-package.t 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; -- cgit v1.2.3