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;
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;
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;
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;
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;
{
fail $@ if $@;
eval <<' GIVEN_TEST_2';
+ BEGIN {
+ if ("$]" >= 5.017_011) {
+ require warnings;
+ warnings->unimport('experimental::smartmatch');
+ }
+ }
use feature 'switch';
local $y;
{
fail $@ if $@;
eval <<' GIVEN_TEST_3';
+ BEGIN {
+ if ("$]" >= 5.017_011) {
+ require warnings;
+ warnings->unimport('experimental::smartmatch');
+ }
+ }
use feature 'switch';
local $y;
{
fail $@ if $@;
eval <<' GIVEN_TEST_4';
+ BEGIN {
+ if ("$]" >= 5.017_011) {
+ require warnings;
+ warnings->unimport('experimental::smartmatch');
+ }
+ }
use feature 'switch';
local $y;
{
fail $@ if $@;
eval <<' GIVEN_TEST_5';
+ BEGIN {
+ if ("$]" >= 5.017_011) {
+ require warnings;
+ warnings->unimport('experimental::smartmatch');
+ }
+ }
use feature 'switch';
local $y;
{
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;
{
fail $@ if $@;
eval <<' GIVEN_TEST_2';
+ BEGIN {
+ if ("$]" >= 5.017_011) {
+ require warnings;
+ warnings->unimport('experimental::smartmatch');
+ }
+ }
use feature 'switch';
local $y;
{
fail $@ if $@;
eval <<' GIVEN_TEST_3';
+ BEGIN {
+ if ("$]" >= 5.017_011) {
+ require warnings;
+ warnings->unimport('experimental::smartmatch');
+ }
+ }
use feature 'switch';
local $y;
{
fail $@ if $@;
eval <<' GIVEN_TEST_4';
+ BEGIN {
+ if ("$]" >= 5.017_011) {
+ require warnings;
+ warnings->unimport('experimental::smartmatch');
+ }
+ }
use feature 'switch';
local $y;
{
fail $@ if $@;
eval <<' GIVEN_TEST_5';
+ BEGIN {
+ if ("$]" >= 5.017_011) {
+ require warnings;
+ warnings->unimport('experimental::smartmatch');
+ }
+ }
use feature 'switch';
local $y;
{
if "$]" < 5.010;
@res = eval <<'TESTCASE';
+ BEGIN {
+ if ("$]" >= 5.017_011) {
+ require warnings;
+ warnings->unimport('experimental::smartmatch');
+ }
+ }
use feature 'switch';
(24, do {
given (25) {
# 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) {
# 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) {
);
sub import {
+ if ("$]" >= 5.017_011) {
+ require warnings;
+ warnings->unimport('experimental::smartmatch');
+ }
+
if ("$]" >= 5.010_001) {
require feature;
feature->import('switch');