Subject: | Can't use an undefined value as an ARRAY reference at ... Test/Trap/Builder.pm line 97. |
When there are certain types of failures in my test cases, I get a
failure in Test::Trap instead.
==============================
10_tests/unit/panel/06_noemail.pl
1..1
Can't use an undefined value as an ARRAY reference at
/home/intellisurvey/versions/6.4/isapps/lib/perl5/site_perl/5.12.3/Test/Trap/Builder.pm
line 97.
Can't use an undefined value as an ARRAY reference at
/home/intellisurvey/versions/6.4/isapps/lib/perl5/site_perl/5.12.3/Test/Trap/Builder.pm
line 97.
ok 1 - no total for addresses
==============================
If I modify line 97 to "my @return = eval { @{$trap->return || []} };",
then I don't get the failure. I can reproduce easily, so I can provide
more information if you need it.
A piece of the debugger output follows.
==============================
DB<1> x $trap
0 Test::Trap=HASH(0xc662e20)
' id ' => '1301609166/32165/1'
'die' => 'Can\'t locate IS/DataFile/Asciidelim.pm in @INC (@INC
contains: /<snip>.pm line 36.
'
'leaveby' => 'die'
'stderr' => "\e[31mCan't locate IS/DataFile/Asciidelim.pm in \@INC
(\@INC contains: <snip>.pm line 36.\cJ\e[0m"
'stdout' => ''
'wantarray' => 1
'warn' => ARRAY(0xbd86180)
empty array
DB<2> n
Test::Trap::Builder::trap(/home/intellisurvey/versions/6.4/isapps/lib/perl5/site_perl/5.12.3/Test/Trap/Builder.pm:98):
98: my @return = eval { @{$trap->return || []} };