diff --git a/lib/B/Deparse-core.t b/lib/B/Deparse-core.t index 2f8bedecc734..043bc6e86a38 100644 --- a/lib/B/Deparse-core.t +++ b/lib/B/Deparse-core.t @@ -38,8 +38,9 @@ use warnings; use strict; use Test::More; -use feature (sprintf(":%vd", $^V)); # to avoid relying on the feature - # logic to add CORE:: +# to avoid relying on the feature logic to add CORE:: +use feature (sprintf(":%s", $^V =~ /^v(5\.\d+|\d+)/g)); + use B::Deparse; my $deparse = B::Deparse->new(); diff --git a/lib/B/Deparse.t b/lib/B/Deparse.t index c39481bbe0e9..6141ea821493 100644 --- a/lib/B/Deparse.t +++ b/lib/B/Deparse.t @@ -1645,7 +1645,7 @@ CORE::evalbytes ''; #### # feature features when feature has been disabled by use VERSION # CONTEXT no warnings 'deprecated'; -use feature (sprintf(":%vd", $^V)); +use feature (sprintf(":%s", $^V =~ /^v(5\.\d+|\d+)/g)); use 1; CORE::say $_; CORE::state $x; @@ -1660,7 +1660,7 @@ CORE::evalbytes ''; # (the above test with CONTEXT, and the output is equivalent but different) # CONTEXT use feature ':5.10'; no warnings 'deprecated'; # feature features when feature has been disabled by use VERSION -use feature (sprintf(":%vd", $^V)); +use feature (sprintf(":%s", $^V =~ /^v(5\.\d+|\d+)/g)); use 1; CORE::say $_; CORE::state $x;