Test::Deep::Cond - simple code test in Tesst::Deep
This document describes Test::Deep::Cond version 0.01.
use Test::Deep; use Test::Deep::Cond; cmp_deeply( { hoge => 3, }, { hoge => cond { 2 < $_ and $_ < 4 }, }, );
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.
code
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.
cond BLOCK
Sets $_ for got value in BLOCK. And if BLOCK return true, this test is passed.
Perl 5.8.1 or later.
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.
perl
Soh Kitahara <sugarbabe335@gmail.com>
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.
To install Test::Deep::Cond, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Test::Deep::Cond
CPAN shell
perl -MCPAN -e shell install Test::Deep::Cond
For more information on module installation, please visit the detailed CPAN module installation guide.