summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
inline | side by side (from parent 1:
5f285d9)
Using if.pm would have been cleaner but it is core only on perl 5.6.2, and
we still support 5.6.1. Moreover, trusting the toolchain on such old perls
is not really an option.
if "$]" < 5.010;
eval <<'TEST_GIVEN';
if "$]" < 5.010;
eval <<'TEST_GIVEN';
+ BEGIN {
+ if ("$]" >= 5.017_011) {
+ require warnings;
+ warnings->unimport('experimental::smartmatch');
+ }
+ }
use feature 'switch';
my $desc = 'given';
my $base = HERE;
use feature 'switch';
my $desc = 'given';
my $base = HERE;
diag $@ if $@;
eval <<'TEST_GIVEN_WHEN';
diag $@ if $@;
eval <<'TEST_GIVEN_WHEN';
+ BEGIN {
+ if ("$]" >= 5.017_011) {
+ require warnings;
+ warnings->unimport('experimental::smartmatch');
+ }
+ }
use feature 'switch';
my $desc = 'when in given';
my $base = HERE;
use feature 'switch';
my $desc = 'when in given';
my $base = HERE;
diag $@ if $@;
eval <<'TEST_GIVEN_DEFAULT';
diag $@ if $@;
eval <<'TEST_GIVEN_DEFAULT';
+ BEGIN {
+ if ("$]" >= 5.017_011) {
+ require warnings;
+ warnings->unimport('experimental::smartmatch');
+ }
+ }
use feature 'switch';
my $desc = 'default in given';
my $base = HERE;
use feature 'switch';
my $desc = 'default in given';
my $base = HERE;
diag $@ if $@;
eval <<'TEST_FOR_WHEN';
diag $@ if $@;
eval <<'TEST_FOR_WHEN';
+ BEGIN {
+ if ("$]" >= 5.017_011) {
+ require warnings;
+ warnings->unimport('experimental::smartmatch');
+ }
+ }
use feature 'switch';
my $desc = 'when in for';
my $base = HERE;
use feature 'switch';
my $desc = 'when in for';
my $base = HERE;
skip 'Perl 5.10 required to test given/when' => 30 if "$]" < 5.010;
eval <<' GIVEN_TEST_1';
skip 'Perl 5.10 required to test given/when' => 30 if "$]" < 5.010;
eval <<' GIVEN_TEST_1';
+ BEGIN {
+ if ("$]" >= 5.017_011) {
+ require warnings;
+ warnings->unimport('experimental::smartmatch');
+ }
+ }
use feature 'switch';
local $y;
{
use feature 'switch';
local $y;
{
fail $@ if $@;
eval <<' GIVEN_TEST_2';
fail $@ if $@;
eval <<' GIVEN_TEST_2';
+ BEGIN {
+ if ("$]" >= 5.017_011) {
+ require warnings;
+ warnings->unimport('experimental::smartmatch');
+ }
+ }
use feature 'switch';
local $y;
{
use feature 'switch';
local $y;
{
fail $@ if $@;
eval <<' GIVEN_TEST_3';
fail $@ if $@;
eval <<' GIVEN_TEST_3';
+ BEGIN {
+ if ("$]" >= 5.017_011) {
+ require warnings;
+ warnings->unimport('experimental::smartmatch');
+ }
+ }
use feature 'switch';
local $y;
{
use feature 'switch';
local $y;
{
fail $@ if $@;
eval <<' GIVEN_TEST_4';
fail $@ if $@;
eval <<' GIVEN_TEST_4';
+ BEGIN {
+ if ("$]" >= 5.017_011) {
+ require warnings;
+ warnings->unimport('experimental::smartmatch');
+ }
+ }
use feature 'switch';
local $y;
{
use feature 'switch';
local $y;
{
fail $@ if $@;
eval <<' GIVEN_TEST_5';
fail $@ if $@;
eval <<' GIVEN_TEST_5';
+ BEGIN {
+ if ("$]" >= 5.017_011) {
+ require warnings;
+ warnings->unimport('experimental::smartmatch');
+ }
+ }
use feature 'switch';
local $y;
{
use feature 'switch';
local $y;
{
skip 'Perl 5.10 required to test given/when' => 30 if "$]" < 5.010;
eval <<' GIVEN_TEST_1';
skip 'Perl 5.10 required to test given/when' => 30 if "$]" < 5.010;
eval <<' GIVEN_TEST_1';
+ BEGIN {
+ if ("$]" >= 5.017_011) {
+ require warnings;
+ warnings->unimport('experimental::smartmatch');
+ }
+ }
use feature 'switch';
local $y;
{
use feature 'switch';
local $y;
{
fail $@ if $@;
eval <<' GIVEN_TEST_2';
fail $@ if $@;
eval <<' GIVEN_TEST_2';
+ BEGIN {
+ if ("$]" >= 5.017_011) {
+ require warnings;
+ warnings->unimport('experimental::smartmatch');
+ }
+ }
use feature 'switch';
local $y;
{
use feature 'switch';
local $y;
{
fail $@ if $@;
eval <<' GIVEN_TEST_3';
fail $@ if $@;
eval <<' GIVEN_TEST_3';
+ BEGIN {
+ if ("$]" >= 5.017_011) {
+ require warnings;
+ warnings->unimport('experimental::smartmatch');
+ }
+ }
use feature 'switch';
local $y;
{
use feature 'switch';
local $y;
{
fail $@ if $@;
eval <<' GIVEN_TEST_4';
fail $@ if $@;
eval <<' GIVEN_TEST_4';
+ BEGIN {
+ if ("$]" >= 5.017_011) {
+ require warnings;
+ warnings->unimport('experimental::smartmatch');
+ }
+ }
use feature 'switch';
local $y;
{
use feature 'switch';
local $y;
{
fail $@ if $@;
eval <<' GIVEN_TEST_5';
fail $@ if $@;
eval <<' GIVEN_TEST_5';
+ BEGIN {
+ if ("$]" >= 5.017_011) {
+ require warnings;
+ warnings->unimport('experimental::smartmatch');
+ }
+ }
use feature 'switch';
local $y;
{
use feature 'switch';
local $y;
{
if "$]" < 5.010;
@res = eval <<'TESTCASE';
if "$]" < 5.010;
@res = eval <<'TESTCASE';
+ BEGIN {
+ if ("$]" >= 5.017_011) {
+ require warnings;
+ warnings->unimport('experimental::smartmatch');
+ }
+ }
use feature 'switch';
(24, do {
given (25) {
use feature 'switch';
(24, do {
given (25) {
# end of the enclosing given block.
@res = ();
eval <<'TESTCASE';
# end of the enclosing given block.
@res = ();
eval <<'TESTCASE';
+ BEGIN {
+ if ("$]" >= 5.017_011) {
+ require warnings;
+ warnings->unimport('experimental::smartmatch');
+ }
+ }
use feature 'switch';
@res = (28, do {
given (29) {
use feature 'switch';
@res = (28, do {
given (29) {
# But calling yield() in when() in for() sends us at the next iteration.
@res = ();
eval <<'TESTCASE';
# But calling yield() in when() in for() sends us at the next iteration.
@res = ();
eval <<'TESTCASE';
+ BEGIN {
+ if ("$]" >= 5.017_011) {
+ require warnings;
+ warnings->unimport('experimental::smartmatch');
+ }
+ }
use feature 'switch';
@res = (31, do {
for (32, 33) {
use feature 'switch';
@res = (31, do {
for (32, 33) {
+ if ("$]" >= 5.017_011) {
+ require warnings;
+ warnings->unimport('experimental::smartmatch');
+ }
+
if ("$]" >= 5.010_001) {
require feature;
feature->import('switch');
if ("$]" >= 5.010_001) {
require feature;
feature->import('switch');