detaint version, if needed (RT#88576, Chris Williams)
[p5sagit/Module-Metadata.git] / t / taint.t
diff --git a/t/taint.t b/t/taint.t
new file mode 100644 (file)
index 0000000..8ca1346
--- /dev/null
+++ b/t/taint.t
@@ -0,0 +1,20 @@
+#!/usr/bin/perl -T
+use strict;
+use warnings;
+
+use 5.008000;   # for ${^TAINT}
+use Module::Metadata;
+use Test::More;
+use Test::Fatal;
+
+ok(${^TAINT}, 'taint flag is set');
+
+# without the fix, we get:
+# Insecure dependency in eval while running with -T switch at lib/Module/Metadata.pm line 668, <GEN0> line 15.
+is(
+    exception { Module::Metadata->new_from_module( "Module::Metadata" )->version },
+    undef,
+    'no exception',
+);
+
+done_testing;