Hi
bliako,
I sense that there's a bit you could do to simplify the task.
When I run your script I get:
C:\_32\pscrpt\inline>perl bliako.pl
Case1: @out
ok 1 - Case1: called success.
ok 2 - Case1: rows are 5
not ok 3 - Case1 : item 0 is ARRAYref.
# Failed test 'Case1 : item 0 is ARRAYref.'
# at bliako.pl line 72.
Bizarre copy of ARRAY in list assignment at C:/perl-5.34.0/lib/Test/Bu
+ilder.pm line 802.
# Tests were run but no plan was declared and done_testing() was not s
+een.
# Looks like your test exited with 255 just after 3.
I therefore wonder "why present us with all of the extra stuff that we don't even get to" ?
Much better, IMO, to consider just the part that's not working. (And then, if needed, proceed to the next part that fails to work when we've fixed the first failure.)
Doing a Devel::Peek::Dump of
$out[$i] reveals that it is an array (and not a reference to an array). At least, that's how it looks to me:
ok 1 - Case1: called success.
ok 2 - Case1: rows are 5
SV = PVAV(0x7ae098) at 0x33cab0
REFCNT = 1
FLAGS = ()
ARRAY = 0x2f0d7d8
FILL = 2
MAX = 3
FLAGS = (REAL)
Elt No. 0
SV = IV(0x33cad0) at 0x33cae0
REFCNT = 1
FLAGS = (IOK,pIOK)
IV = 42
Elt No. 1
SV = IV(0x33cab8) at 0x33cac8
REFCNT = 1
FLAGS = (IOK,pIOK)
IV = 42
Elt No. 2
SV = IV(0x33cb30) at 0x33cb40
REFCNT = 1
FLAGS = (IOK,pIOK)
IV = 42
not ok 3 - Case1 : item 0 is ARRAYref.
# Failed test 'Case1 : item 0 is ARRAYref.'
So the test is reporting correctly.
I'm also a bit puzzled about the involvement of Test/Builder.pm. Do you know what it is it that pulls that module in ?
Cheers,
Rob
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.