]> git.vpit.fr Git - perl/modules/indirect.git/blobdiff - t/12-env.t
Add the PERL_INDIRECT_PM_DISABLE environment variable
[perl/modules/indirect.git] / t / 12-env.t
diff --git a/t/12-env.t b/t/12-env.t
new file mode 100644 (file)
index 0000000..2e3584b
--- /dev/null
@@ -0,0 +1,19 @@
+#!perl
+
+use strict;
+use warnings;
+
+use Test::More tests => 3;
+
+{
+ local $ENV{PERL_INDIRECT_PM_DISABLE} = 1;
+ my $err = 0;
+ my $res = eval <<' TEST_ENV_VARIABLE';
+  return 1;
+  no indirect hook => sub { ++$err };
+  my $x = new Flurbz;
+ TEST_ENV_VARIABLE
+ is $@,   '', 'PERL_INDIRECT_PM_DISABLE test doesn\'t croak';
+ is $res, 1,  'PERL_INDIRECT_PM_DISABLE test returns the correct value';
+ is $err, 0,  'PERL_INDIRECT_PM_DISABLE test didn\'t generate any error';
+}