diff options
author | Zefram <zefram@fysh.org> | 2017-11-28 20:26:07 +0000 |
---|---|---|
committer | Zefram <zefram@fysh.org> | 2017-11-28 20:26:59 +0000 |
commit | 5086635a9f7a492b5a0c6228ecf7a22abbabeef6 (patch) | |
tree | f560d15d26ee648cc939215ae4c6ffdadd7ab4df /ext | |
parent | 869b8c119a7436d3373e1325925a8b753d0e7805 (diff) | |
download | perl-5086635a9f7a492b5a0c6228ecf7a22abbabeef6.tar.gz |
avoid gratuitous given/when in test
Diffstat (limited to 'ext')
-rw-r--r-- | ext/XS-APItest/t/grok.t | 23 |
1 files changed, 9 insertions, 14 deletions
diff --git a/ext/XS-APItest/t/grok.t b/ext/XS-APItest/t/grok.t index e4eaa4508f..b6ad905b60 100644 --- a/ext/XS-APItest/t/grok.t +++ b/ext/XS-APItest/t/grok.t @@ -4,7 +4,6 @@ use strict; use Test::More; use Config; use XS::APItest; -use feature 'switch'; no warnings 'experimental::smartmatch'; use constant TRUTH => '0 but true'; @@ -31,19 +30,15 @@ foreach my $leader ('', ' ', ' ') { { my (@UV, @NV); - given ($Config{ivsize}) { - when ($_ == 4) { - @UV = qw(429496729 4294967290 4294967294 4294967295); - @NV = qw(4294967296 4294967297 4294967300 4294967304); - } - when ($_ == 8) { - @UV = qw(1844674407370955161 18446744073709551610 - 18446744073709551614 18446744073709551615); - @NV = qw(18446744073709551616 18446744073709551617 - 18446744073709551620 18446744073709551624); - } - die "Unknown IV size $_"; - } + if ($Config{ivsize} == 4) { + @UV = qw(429496729 4294967290 4294967294 4294967295); + @NV = qw(4294967296 4294967297 4294967300 4294967304); + } elsif ($Config{ivsize} == 8) { + @UV = qw(1844674407370955161 18446744073709551610 + 18446744073709551614 18446744073709551615); + @NV = qw(18446744073709551616 18446744073709551617 + 18446744073709551620 18446744073709551624); + } else { die "Unknown IV size $Config{ivsize}" } foreach (@UV) { my $string = $leader . $_ . $trailer; my ($flags, $value) = grok_number($string); |