Skip to content

Commit

Permalink
Add documentation for is_deeply limitations
Browse files Browse the repository at this point in the history
Fixes #595
  • Loading branch information
exodist committed Aug 18, 2016
1 parent c911036 commit 3f1eec0
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Changes
@@ -1,5 +1,7 @@
{{$NEXT}}

- Document limitations in is_deeply (#595)

1.302051 2016-08-11 20:26:22-07:00 America/Los_Angeles (TRIAL RELEASE)

- Fix setting hub when getting context
Expand Down
14 changes: 14 additions & 0 deletions lib/Test/More.pm
Expand Up @@ -1064,6 +1064,20 @@ improve in the future.
L<Test::Differences> and L<Test::Deep> provide more in-depth functionality
along these lines.
B<NOTE> is_deeply() has limitations when it comes to comparing strings and
refs:
my $path = path('.');
my $hash = {};
is_deeply( $path, "$path" ); # ok
is_deeply( $hash, "$hash" ); # fail
This happens because is_deeply will unoverload all arguments unconditionally.
It is probably best not to use is_deeply with overloading. For legacy reasons
this is not likely to ever be fixed. If you would like a much better tool for
this you should see L<Test2::Suite> Specifically L<Test2::Tools::Compare> has
an C<is()> function that works like C<is_deeply> with many improvements.
=cut

our( @Data_Stack, %Refs_Seen );
Expand Down
1 change: 1 addition & 0 deletions xt/author/pod-spell.t
Expand Up @@ -87,6 +87,7 @@ subevents
testability
TIEHANDLE
tie-ing
unoverload
VMS
vmsperl
YESNO
Expand Down

0 comments on commit 3f1eec0

Please sign in to comment.