[interchange] * Work around unit test problem caused by UTF-8.

Mike Heins interchange-cvs at icdevgroup.org
Tue Apr 5 18:24:41 UTC 2016


commit 6f3c3bc345fc08078f017041a95b985b9b88d22f
Author: Mike Heins <mike at perusion.com>
Date:   Tue Apr 5 14:23:26 2016 -0400

    * Work around unit test problem caused by UTF-8.
    
    * There may be some underlying Safe problems with UTF-8, which should
      be tested against the latest Vend::Safe initialization. But this
      prevents the test problem.

 lib/Vend/Safe.pm |    4 +++-
 test.pl          |    3 +++
 2 files changed, 6 insertions(+), 1 deletions(-)
---
diff --git a/lib/Vend/Safe.pm b/lib/Vend/Safe.pm
index c9ae0de..62a4e7f 100644
--- a/lib/Vend/Safe.pm
+++ b/lib/Vend/Safe.pm
@@ -35,7 +35,9 @@ sub new {
     my ($invocant, @args) = @_;
 
     my $safe = Safe->new(@args);
-    $invocant->initialize_safe_compartment($safe);
+
+	## UTF-8 may cause testing problems on some systems
+    $invocant->initialize_safe_compartment($safe) unless $ENV{MINIVEND_TEST};
 
     return $safe;
 }
diff --git a/test.pl b/test.pl
index 0608b2f..21a120d 100644
--- a/test.pl
+++ b/test.pl
@@ -32,6 +32,9 @@ if($^O =~ /cygwin|win32/) {
 die "Must be in build directory\n" unless -d 'blib';
 die "No tests defined for Windows\n" if $^O =~ /win32/i;
 
+### This tells certain modules to ignore some initialization when doing unit tests
+$ENV{MINIVEND_TEST} = 1;
+
 $ENV{MINIVEND_ROOT} = "$cur_dir/blib";
 $ENV{MINIVEND_PORT} = 8786 unless defined $ENV{MINIVEND_PORT};
 



More information about the interchange-cvs mailing list