From b6d3d6562b2735a1f766c4ceb55a254551dd4df2 Mon Sep 17 00:00:00 2001 From: mertz Date: Fri, 17 Sep 2004 11:51:10 +0000 Subject: correcting tests so that testing labels / fields wo labelformat of corresponding to not-defined fields in the mlabelformat DO WORK with 3.30 --- Perl/t/Bbox.t | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) (limited to 'Perl') diff --git a/Perl/t/Bbox.t b/Perl/t/Bbox.t index dcb0e1a..226186b 100644 --- a/Perl/t/Bbox.t +++ b/Perl/t/Bbox.t @@ -1,7 +1,7 @@ #!/usr/bin/perl -w # -# $Id: Bbox.t,v 1.5 2004-09-09 07:52:44 lecoanet Exp $ +# $Id: Bbox.t,v 1.6 2004-09-17 11:51:10 mertz Exp $ # Author: Christophe Mertz # @@ -112,26 +112,25 @@ ok(&similarFlatArray ([$zinc->bbox($txt4)], ### testing bbox of fields or labels of track/waypoint and tabular items my $track = $zinc->add('track', 1, 4, -position => [56, 78]); -#print "bbox1=(", join(',', $zinc->bbox(-label, $track)),")\n"; +# print "bbox11=(", $bbox,")\n"; - is_deeply([ $zinc->bbox(-label, $track) ], - [ ], - "bbox of a track label without labelformat"); +is($zinc->bbox(-label, $track), (), + "bbox of a track label without labelformat is ()"); -#print "bbox=(", join(',', $zinc->bbox(-field, 2, $track)),")\n"; -is_deeply ([ $zinc->bbox(-field, 2, $track) ], - [ ], - "bbox of a track field without labelformat"); +my $bbox = $zinc->bbox(-field, 0, $track); +#print "bbox22=(", $bbox,")\n"; + +is( $bbox, undef, "bbox of a track field without labelformat is undef"); $zinc->itemconfigure($track, -labelformat => 'x20x18+0+0'); #print "bbox=(", join(',', $zinc->bbox(-label, $track)),")\n"; +$bbox = eval { $zinc->bbox(-field, 4, $track) } ; +#print "bbox=(", $bbox,")\n"; -#print "bbox=(", join(',', $zinc->bbox(-field, 4, $track)),")\n"; -is_deeply ([ $zinc->bbox(-field, 4, $track) ], - [ ], - "bbox of an empty track field"); +is( $bbox, (), + "bbox of a track field which field is out of bound is undef"); my $wpt = $zinc->add('waypoint', 1, 0, -position => [561, 781]); #print "wpt bbox=(", join(',', $zinc->bbox($wpt)),")\n"; -- cgit v1.1