Hello tomred, and congratulations on your first post!
MockObj::files is not an array, it’s an array reference. So instead of assigning to an array variable:
my @strings = $mock->files;
you should assign to a scalar:
my $strings = $mock->files; note explain $strings; cmp_deeply($strings, bag(@list));
which gives the desired test result:
1:14 >perl 2056_SoPW.pl # [ # 'string one', # 'Different string', # 'With feeling' # ] # [ # 'string one', # 'Different string', # 'With feeling' # ] ok 1 1..1 1:14 >
Hope that helps,
| Athanasius <°(((>< contra mundum | Iustus alius egestas vitae, eros Piratica, |
In reply to Re: Assigning to an ArrayRef accessor type
by Athanasius
in thread Assigning to a ArrayRef accessor type
by tomred
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |