Skip to content

Commit 53353e5

Browse files
Fergal Dalyschwern
authored andcommitted
import Test-Deep 0.102 from CPAN
git-cpan-module: Test-Deep git-cpan-version: 0.102 git-cpan-authorid: FDALY git-cpan-file: authors/id/F/FD/FDALY/Test-Deep-0.102.tar.gz
1 parent afd9cd2 commit 53353e5

File tree

5 files changed

+40
-7
lines changed

5 files changed

+40
-7
lines changed

CHANGES

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
0.102
2+
3+
Behave well when a code comparator doesn't give diagnostics. Thanks to
4+
Alex Kapranoff.
5+
16
0.101
27

38
Fix an overloading problem with All and Any. Thanks to Kostas

META.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# http://module-build.sourceforge.net/META-spec.html
22
#XXXXXXX This is a prototype!!! It will change in the future!!! XXXXX#
33
name: Test-Deep
4-
version: 0.101
4+
version: 0.102
55
version_from: ./lib/Test/Deep.pm
66
installdirs: perl
77
requires:

lib/Test/Deep.pm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ use vars qw(
2525
$Snobby $Expects $DNE $DNE_ADDR $Shallow
2626
);
2727

28-
$VERSION = '0.101';
28+
$VERSION = '0.102';
2929

3030
require Exporter;
3131
@ISA = qw( Exporter );

lib/Test/Deep/Code.pm

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,20 @@ sub diagnostics
3737
Ran coderef at $where on
3838
3939
$data
40-
40+
EOM
41+
if (defined($error))
42+
{
43+
$diag .= <<EOM;
4144
and it said
4245
$error
4346
EOM
47+
}
48+
else
49+
{
50+
$diag .= <<EOM;
51+
it failed but it didn't say why.
52+
EOM
53+
}
4454

4555
return $diag;
4656
}

t/code.t

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,14 @@ sub cmp
1111
{
1212
return 1;
1313
}
14-
else
14+
elsif ($str eq "feargal")
1515
{
16-
return (0, "your names not down, you're not coming in");
16+
return (0, "your name's not down, you're not coming in");
1717
}
18+
else
19+
{
20+
return 0;
21+
}
1822
}
1923

2024
{
@@ -29,7 +33,8 @@ sub cmp
2933
"code ok"
3034
);
3135

32-
my ($prem, $res) = check_test(
36+
my ($prem, $res);
37+
($prem, $res) = check_test(
3338
sub {
3439
cmp_deeply("feargal", code(\&cmp));
3540
},
@@ -39,6 +44,19 @@ sub cmp
3944
"code not ok"
4045
);
4146

42-
like($res->{diag}, "/your names not down/", "diagnostics");
47+
like($res->{diag}, "/your name's not down/", "diagnostics");
4348
like($res->{diag}, "/feargal/", "diagnostics");
49+
50+
($prem, $res) = check_test(
51+
sub {
52+
cmp_deeply("fazzer", code(\&cmp));
53+
},
54+
{
55+
actual_ok => 0,
56+
},
57+
"code not ok"
58+
);
59+
60+
like($res->{diag}, "/it failed but it didn't say why/", "no diagnostics");
61+
like($res->{diag}, "/fazzer/", "no diagnostics");
4462
}

0 commit comments

Comments
 (0)