I have a deeply nested data-structure supposed to return contain scalar refs.
But is_deeply() digs into the refs and compares the scalar values.
I can understand why array- and hash-refs are dereferenced ...
Any elegant way to solve this? I also tried Test::Deep::cmp_deeply() but no success
will try Test::Differences now ...
use strict; use warnings; use Data::Dump qw/pp dd/; use Test::More; use Test::Deep; my ($pos1,$pos2)=("a","a"); diag \$pos1,", ",\$pos2; diag 0+\$pos1,", ",0+\$pos2; diag pp \$pos1,\$pos2; is_deeply( \$pos1, \$pos2,"is_deeply"); #should fail cmp_deeply( \$pos1, \$pos2,"cmp_deeply"); #should fail done_testing;
C:/Perl_524/bin\perl.exe -w d:/exp/pm_is_deeply.pl ok 1 - is_deeply ok 2 - cmp_deeply # SCALAR(0xd286e8), SCALAR(0xd28d48) # 13797096, 13798728 # (\"a", \"a") 1..2
Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery
In reply to Test scalar refs (not values) in deeply nested structure by LanX
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |