-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add test for children not matching working as expected
- Loading branch information
1 parent
37531a1
commit a46add0
Showing
1 changed file
with
34 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |