Skip to content

Commit

Permalink
Add test for children not matching working as expected
Browse files Browse the repository at this point in the history
  • Loading branch information
kentfredric committed Aug 14, 2015
1 parent 37531a1 commit a46add0
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions t/05-child-nonmatch.t
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
use strict;
use warnings;

use Test::Tester 0.08;
use Test::More;

use Test::Deep qw( cmp_deeply superhashof re all );
use Test::Deep::Filter qw( filter );

our $TODO;

can_ok( 'main', qw( filter cmp_deeply ) );

subtest "Split-filter" => sub {
my ( $premature, @results ) = run_tests(
sub {
cmp_deeply( "Hello World", filter( sub { [ split /\s+/, $_ ] }, [qw( Foo Bar )] ), "Comparing a word by its split tokens" );
},
);
cmp_deeply(
\@results,
[
superhashof(
{
diag => re(qr/expect\s*:\s*'Foo'/),
ok => 0,
actual_ok => 0,
}
)
],
"Split tokens is OK"
) or note explain $premature, \@results;
};
done_testing;

0 comments on commit a46add0

Please sign in to comment.