I'm seeing ... "interesting" behavior with some new development. My (so far) last test:
# -*- perl -*- # t/001_load.t - check module loading and create testing directory use lib qw# /plugins #; use UtcleDB; use Data::Dumper; use Test::More qw( no_plan ); my $dbh = UtcleDB->connect(); BEGIN { use_ok( 'ConferenceNameBuilder' ); } my $object = ConferenceNameBuilder->new( DBH => $dbh ); isa_ok ($object, 'ConferenceNameBuilder'); can_ok ($object, 'foundation_list'); my $list = $object->foundation_list(); eq_array( $list );
the
$object->foundation_list returns, and this may be important, an arrayr +ef containing the list elements. that's been verified (with Data::Du +mper ... it's an array of hashrefs intended to be passed into some op +tions menus.) <p> but ... the 'eq_array' test is failing .. sort of: <code> [me --> ]$ make test PERL_DL_NONLAZY=1 /usr/bin/perl "-MExtUtils::Command::MM" "-e" "test_h +arness(0, 'blib/lib', 'blib/arch')" t/*.t t/001_load.........ok + t/002_functions....ok + t/003_names........ok + t/004_list.........ok + t/005_listall......ok 1/0Use of uninitialized value in string eq at /u +sr/lib/perl5/5.8.7/Test/More.pm line 1126. Use of uninitialized value in string at /usr/lib/perl5/5.8.7/Test/More +.pm line 1132. t/005_listall......ok + All tests successful. Files=5, Tests=17, 0 wallclock secs ( 0.28 cusr + 0.06 csys = 0.34 +CPU)
it's not a critical warning, but it's a touch annoying. it's also not from passing the arrayref ...

i'd rather not have an 'misleading' test result. any ideas?

UPDATE: what i wanted was really three tests:

ok( ref( $list ) eq 'ARRAY', 'returned a list' ); ok( scalar( @$list ), 'returned a populated list' ); ok( ref( $list->[0] ) eq 'HASH', 'first element is a hashref ...' );
thanks!

In reply to Test::More and is_array by geektron

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.