The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Test::Proto::Compare - base class for comparisons.

SYNOPSIS

        Test::Proto::Compare->new->compare('aaa', 'aab'); # -1

This is a base class for comparison functions.

METHODS

new

        Test::Proto::Compare->new(sub{lc shift cmp lc shift;});

The new function takes an argument, the coderef which is used to do the comparison. It is optional, and defaults to cmp.

compare

        $c->compare($a,$b);

This method will compare two arguments and return the result.

reverse

        $c->reverse->compare($a,$b);
        # i.e.   $c->compare($b,$a);

Calling this method will reverse the order in which the arguments are fed to the comparison functions.

OTHER INFORMATION

For author, version, bug reports, support, etc, please see Test::Proto.