Created a test for import of a single log function failing per
[p5sagit/Log-Contextual.git] / t / regression_83267.t
CommitLineData
67d7bb36 1use strict;
2use warnings;
3use Test::More qw(no_plan);
4
5#original bug report https://rt.cpan.org/Public/Bug/Display.html?id=83267
6
7#The following code from Module::Metadata exposed the bug
8#BEGIN {
9# if ($INC{'Log/Contextual.pm'}) {
10# Log::Contextual->import('log_info');
11# } else {
12# *log_info = sub (&) { warn $_[0]->() };
13# }
14#}
15
16
17#bug report does not include a case where Log::Contextual is
18#brought in via 'use'
19require Log::Contextual;
20
21#try to import a single log function but do not include any tags
22eval { Log::Contextual->import('log_info') };
23ok(! $@, 'Imported log function correctly');