Algorithm-Numerical-Shuffle
view release on metacpan or search on metacpan
t/000_tests.t view on Meta::CPAN
2324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778eval
{
my
@a
= shuffle ();
if
(
@a
) {
"not ok "
,
$test_num
++,
"\n"
;
}
else
{
"ok "
,
$test_num
++,
"\n"
;
}
};
if
($@) {
"... error: $@\n"
;}
eval
{
my
$a
= [];
shuffle
$a
;
if
(
@$a
) {
"not ok "
,
$test_num
++,
"\n"
;
}
else
{
"ok "
,
$test_num
++,
"\n"
;
}
};
if
($@) {
"... error: $@\n"
;}
eval
{
my
@a
= (0 .. 9);
my
@b
= shuffle
@a
;
my
@c
=
sort
{
$a
<=>
$b
}
@b
;
if
(
@a
!=
@c
||
"@a"
ne
"@c"
) {
"not ok "
,
$test_num
++,
"\n"
;
}
else
{
"ok "
,
$test_num
++,
"\n"
;
}
};
if
($@) {
"... error: $@\n"
;}
eval
{
my
$A
= [0 .. 9];
my
$B
= [0 .. 9];
shuffle
$B
;
my
@C
=
sort
{
$a
<=>
$b
}
@$B
;
if
(
@$A
!=
@C
||
"@$A"
ne
"@C"
) {
"not ok "
,
$test_num
++,
"\n"
;
}
else
{
"ok "
,
$test_num
++,
"\n"
;
}
};
if
($@) {
"... error: $@\n"
;}
( run in 0.963 second using v1.01-cache-2.11-cpan-95122f20152 )