From: Vincent Pit Date: Wed, 24 Aug 2011 13:35:35 +0000 (+0200) Subject: Replace $] by "$]" X-Git-Tag: v0.04~1 X-Git-Url: http://git.vpit.fr/?a=commitdiff_plain;h=d3e5f75f3c4d82429e8ef9dccf275e4e8e6d4260;p=perl%2Fmodules%2FTest-Leaner.git Replace $] by "$]" An old bug could cause $] to be initialized to a wrong decimal value. Since its stringified value was always right, we use it instead. Occurences of $^V were also replaced by $]. --- diff --git a/lib/Test/Leaner.pm b/lib/Test/Leaner.pm index d03741f..54550e0 100644 --- a/lib/Test/Leaner.pm +++ b/lib/Test/Leaner.pm @@ -82,7 +82,7 @@ my $main_process; BEGIN { $main_process = $$; - if ($] >= 5.008 and $INC{'threads.pm'}) { + if ("$]" >= 5.008 and $INC{'threads.pm'}) { my $use_ithreads = do { require Config; no warnings 'once'; @@ -495,7 +495,7 @@ my %binops = ( 'and' => 'and', '||' => 'hor', - ('//' => 'dor') x ($] >= 5.010), + ('//' => 'dor') x ("$]" >= 5.010), '&&' => 'hand', '|' => 'bor', @@ -520,7 +520,7 @@ my %binops = ( '=~' => 'like', '!~' => 'unlike', - ('~~' => 'smartmatch') x ($] >= 5.010), + ('~~' => 'smartmatch') x ("$]" >= 5.010), '+' => 'add', '-' => 'substract', diff --git a/t/03-fallback.t b/t/03-fallback.t index 9c2451e..c57c45e 100644 --- a/t/03-fallback.t +++ b/t/03-fallback.t @@ -4,7 +4,7 @@ use strict; use warnings; BEGIN { - if ($^V ge v5.8.4 and $^V le v5.8.5) { + if ("$]" >= 5.008004 and "$]" <= 5.008005) { require Test::More; Test::More::plan(skip_all => 'goto may segfault randomly on perl 5.8.4 and 5.8.5'); diff --git a/t/80-threads.t b/t/80-threads.t index 8d872ee..639c118 100644 --- a/t/80-threads.t +++ b/t/80-threads.t @@ -19,7 +19,7 @@ BEGIN { skipall 'This perl wasn\'t built to support threads' unless $Config{useithreads}; skipall 'perl 5.13.4 required to test thread safety' - unless $force or $] >= 5.013004; + unless $force or "$]" >= 5.013004; skipall "threads $t_v required to test thread safety" unless eval "use threads $t_v; 1"; } diff --git a/t/lib/Test/Leaner/TestHelper.pm b/t/lib/Test/Leaner/TestHelper.pm index fffb001..29db429 100644 --- a/t/lib/Test/Leaner/TestHelper.pm +++ b/t/lib/Test/Leaner/TestHelper.pm @@ -7,7 +7,7 @@ my $memory_stream; my $buf_ref; sub capture_to_buffer { - return unless $] >= 5.008; + return unless "$]" >= 5.008; die "Can't call capture_to_buffer twice" if $memory_stream; diff --git a/t/lib/Test/Leaner/TestImport.pm b/t/lib/Test/Leaner/TestImport.pm index 0c55681..30f786c 100644 --- a/t/lib/Test/Leaner/TestImport.pm +++ b/t/lib/Test/Leaner/TestImport.pm @@ -78,7 +78,7 @@ sub test_import_arg { local $Test::Builder::Level = ($Test::Builder::Level || 0) + 1; my $use_fallback = $ENV{PERL_TEST_LEANER_USES_TEST_MORE}; - if ($use_fallback and $^V ge v5.8.4 and $^V le v5.8.5) { + if ($use_fallback and "$]" >= 5.008004 and "$]" <= 5.008005) { Test::More::plan(skip_all => 'goto may segfault randomly on perl 5.8.4 and 5.8.5'); } else {