From aa3f08493d04303e253459eeb8182d8352984ace Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Wed, 10 Jul 2013 17:21:17 -0400 Subject: allow getting functions to export from other places --- t/export-hash.t | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 t/export-hash.t (limited to 't') 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; -- cgit v1.2.3-54-g00ecf