diff options
author | Jesse Luehrs <doy@tozt.net> | 2013-07-10 17:21:17 -0400 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2013-07-10 17:21:17 -0400 |
commit | aa3f08493d04303e253459eeb8182d8352984ace (patch) | |
tree | 224ef2737939349d370e994673cc559b07d5d4d7 /t/export-hash.t | |
parent | 4fcfb4266551771b302eb4d4a3fcf40c7bffada8 (diff) | |
download | exporter-lexical-aa3f08493d04303e253459eeb8182d8352984ace.tar.gz exporter-lexical-aa3f08493d04303e253459eeb8182d8352984ace.zip |
allow getting functions to export from other places
Diffstat (limited to 't/export-hash.t')
-rw-r--r-- | t/export-hash.t | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/t/export-hash.t b/t/export-hash.t new file mode 100644 index 0000000..e637a40 --- /dev/null +++ b/t/export-hash.t @@ -0,0 +1,22 @@ +#!/usr/bin/env perl +use strict; +use warnings; +use Test::More; + +package Foo { + use Exporter::Lexical -exports => { + foo => sub { "FOO" }, + }; + BEGIN { $INC{'Foo.pm'} = __FILE__ } +} + +sub foo { 'foo' } + +is(foo(), 'foo'); +{ + use Foo; + is(foo(), 'FOO'); +} +is(foo(), 'foo'); + +done_testing; |