"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "cpan/Scalar-List-Utils/t/shuffle.t" between
perl-5.32.0-RC0.tar.xz and perl-5.32.0-RC1.tar.xz

About: Perl (Practical Extraction and Report Language) is a high-level, general-purpose, interpreted, dynamic programming language. Release candidate.

shuffle.t  (perl-5.32.0-RC0.tar.xz):shuffle.t  (perl-5.32.0-RC1.tar.xz)
#!./perl #!./perl
use strict; use strict;
use warnings; use warnings;
use Test::More tests => 6; use Test::More tests => 7;
use List::Util qw(shuffle); use List::Util qw(shuffle);
my @r; my @r;
@r = shuffle(); @r = shuffle();
ok( !@r, 'no args'); ok( !@r, 'no args');
@r = shuffle(9); @r = shuffle(9);
is( 0+@r, 1, '1 in 1 out'); is( 0+@r, 1, '1 in 1 out');
is( $r[0], 9, 'one arg'); is( $r[0], 9, 'one arg');
my @in = 1..100; my @in = 1..100;
@r = shuffle(@in); @r = shuffle(@in);
is( 0+@r, 0+@in, 'arg count'); is( 0+@r, 0+@in, 'arg count');
isnt( "@r", "@in", 'result different to args'); isnt( "@r", "@in", 'result different to args');
my @s = sort { $a <=> $b } @r; my @s = sort { $a <=> $b } @r;
is( "@in", "@s", 'values'); is( "@in", "@s", 'values');
{
local $List::Util::RAND = sub { 4/10 }; # chosen by a fair die
@r = shuffle(1..10);
is_deeply(
[ shuffle(1..10) ],
[ shuffle(1..10) ],
'rigged rand() yields predictable output'
);
}
 End of changes. 6 change blocks. 
6 lines changed or deleted 6 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)