Acme-Sort-Bozo

 view release on metacpan or  search on metacpan

t/00-load.t  view on Meta::CPAN

    1, 
    "is_ordered( \&compare, [ qw/ A B C D E / ] ) returns true." 
);

isnt(
    Acme::Sort::Bozo::is_ordered( $compare, [ qw/ E D C B A / ] ),
    1,
    "is_ordered( \&compare, [ qw/ E D C B A / ] ) returns false."
);

undef $caught;
try {
    Acme::Sort::Bozo::is_ordered( [ qw/ A B C D E / ] );
} catch { $caught = $_ };
like( 
    $caught, 
    qr/expects a coderef/, 
    "is_ordered() throws exception when not handed a coderef as first param."
);

undef $caught;
try {
    Acme::Sort::Bozo::is_ordered( $compare, qw/ A B C D E / );
} catch { $caught = $_ };
like(
    $caught,
    qr/expects an arrayref/,
    "is_ordered() throws an exception when not handed an arrayref as second param."
);

note "Testing Acme::Sort::Bozo::swap()";



( run in 0.891 second using v1.01-cache-2.11-cpan-d80b1682f3f )