From: Tyler Riddle Date: Tue, 12 Feb 2013 04:25:06 +0000 (-0800) Subject: Created a test for import of a single log function failing per X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=67d7bb3679043d85d4d970dd6611bf5a4e928993;p=p5sagit%2FLog-Contextual.git Created a test for import of a single log function failing per https://rt.cpan.org/Public/Bug/Display.html?id=83267 --- diff --git a/t/regression_83267.t b/t/regression_83267.t new file mode 100644 index 0000000..36bb76e --- /dev/null +++ b/t/regression_83267.t @@ -0,0 +1,23 @@ +use strict; +use warnings; +use Test::More qw(no_plan); + +#original bug report https://rt.cpan.org/Public/Bug/Display.html?id=83267 + +#The following code from Module::Metadata exposed the bug +#BEGIN { +# if ($INC{'Log/Contextual.pm'}) { +# Log::Contextual->import('log_info'); +# } else { +# *log_info = sub (&) { warn $_[0]->() }; +# } +#} + + +#bug report does not include a case where Log::Contextual is +#brought in via 'use' +require Log::Contextual; + +#try to import a single log function but do not include any tags +eval { Log::Contextual->import('log_info') }; +ok(! $@, 'Imported log function correctly');