NAME

Test::Deep::Cond - simple code test in Tesst::Deep

VERSION

This document describes Test::Deep::Cond version 0.01.

SYNOPSIS

use Test::Deep;
use Test::Deep::Cond;

cmp_deeply(
    {
        hoge => 3,
    },
    {
        hoge => cond { 2 < $_ and $_ < 4 },
    },
);

DESCRIPTION

Test::Deep::Cond is simple way to compare value by code reference. Test::Deep provides code function. But, Test::Deep::Cond is more simply to test.

cmp_deeply(
    {
        hoge => 3,
    },
    {
        hoge => code(sub { my $val = shift; 2 < $val and $val < 4 }),
    },
);

This is same meaning as SYNOPSIS by Test::Deep::Code.

INTERFACE

Functions

cond BLOCK

Sets $_ for got value in BLOCK. And if BLOCK return true, this test is passed.

DEPENDENCIES

Perl 5.8.1 or later.

BUGS

All complex software has bugs lurking in it, and this module is no exception. If you find a bug please either email me, or add the bug to cpan-RT.

SEE ALSO

perl

AUTHOR

Soh Kitahara <sugarbabe335@gmail.com>

LICENSE AND COPYRIGHT

Copyright (c) 2013, Soh Kitahara. All rights reserved.

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.