geektron has asked for the wisdom of the Perl Monks concerning the following question:
the# -*- 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 );
it's not a critical warning, but it's a touch annoying. it's also not from passing the arrayref ...$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)
i'd rather not have an 'misleading' test result. any ideas?
UPDATE: what i wanted was really three tests:
thanks!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 ...' );
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Test::More and is_array
by tlm (Prior) on Jun 09, 2005 at 20:24 UTC | |
by geektron (Curate) on Jun 09, 2005 at 20:33 UTC | |
by tlm (Prior) on Jun 09, 2005 at 20:43 UTC | |
by geektron (Curate) on Jun 09, 2005 at 20:45 UTC | |
|
Re: Test::More and is_array
by stvn (Monsignor) on Jun 09, 2005 at 20:25 UTC | |
by geektron (Curate) on Jun 09, 2005 at 20:34 UTC | |
by stvn (Monsignor) on Jun 10, 2005 at 19:36 UTC | |
by geektron (Curate) on Jun 10, 2005 at 20:31 UTC | |
by adrianh (Chancellor) on Jun 11, 2005 at 22:23 UTC | |
| |
by stvn (Monsignor) on Jun 11, 2005 at 01:44 UTC |