- or download this
use Test::Refute;
is 42, 42, "this holds";
like "foo", qr/bar/, "this fails";
done_testing; # this is mandatory, even if plan declared
- or download this
use Test::Refute::Contract;
my $c = Test::Refute::Contract->new;
$c->is($user_input, 42);
$c->like($another_input, qr/f?o?r?m?a?t/);
if ($c->is_valid) ...
- or download this
use Test::Refute qw(no_init);
my $c = contract {
is $user_input, 42;
like $another_input, qr/f?o?r?m?a?t/;
};
# analyze $c here ...
- or download this
build_refute my_is => sub {
$_[0] ne $_[1] && "$_[0] != $_[1]";
}, args => 2, export => 1;
# take 2 to 3 args; export by default
- or download this
use Test::Refute;
use My::Test::Module;
...
note $c->get_tap;
done_testing;