Created a test for import of a single log function failing per
Tyler Riddle [Tue, 12 Feb 2013 04:25:06 +0000 (20:25 -0800)]
https://rt.cpan.org/Public/Bug/Display.html?id=83267

t/regression_83267.t [new file with mode: 0644]

diff --git a/t/regression_83267.t b/t/regression_83267.t
new file mode 100644 (file)
index 0000000..36bb76e
--- /dev/null
@@ -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');