Help language development. Donate to The Perl Foundation

List::Util zef:lizmat last updated on 2021-09-09

t/shuffle.t
use v6.*;

use List::Util <shuffle>;

use Test;

plan 7;

ok defined(&shuffle), 'shuffle defined';

my @r = shuffle();
ok [email protected],    'no args';

@r = shuffle(9);
is [email protected], 1,' 1 in 1 out';
is @r[0], 9, 'one arg';

my @in = 1..100;
@r = shuffle(@in);
is [email protected], [email protected], 'elem count';
isnt "@r[]", "@in[]", 'result different to args';

my @s = sort @r;
is "@in[]", "@s[]", 'values';

# vim: expandtab shiftwidth=4