From 4ee2d52f536ad56d823f0d6c4d9dcaf8c9758ab6 Mon Sep 17 00:00:00 2001 From: Bernardo Gonzalez Kriegel Date: Fri, 23 Oct 2015 13:40:45 -0300 Subject: [PATCH] Bug 14468: followup to fix tests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This patch fix an expected test result. Also changes a comparison for the return value to 'delete' layout sub, in case of success it returns 'undef' and triggers the message 'use of uninitialized value $del_results ...' To test: 1) Whitout this patch prove t/db_dependent/Labels/t_Layout.t fails. Also note the message "Use of uninitialized value $del_results in string ne at t/db_dependent/Labels/t_Layout.t line 110." for using the return value of delete layout (undef on success!) 2) Apply the patch 3) Test pass and no more message Signed-off-by: Marc VĂ©ron --- t/db_dependent/Labels/t_Layout.t | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/t/db_dependent/Labels/t_Layout.t b/t/db_dependent/Labels/t_Layout.t index 86f57a6..87db848 100644 --- a/t/db_dependent/Labels/t_Layout.t +++ b/t/db_dependent/Labels/t_Layout.t @@ -102,11 +102,11 @@ my $updated_layout = C4::Labels::Layout->retrieve(layout_id => $sav_results); is_deeply($updated_layout, $saved_layout, "Updated layout object is the expected"); # Testing Layout->get_text_wrap_cols() -is($updated_layout->get_text_wrap_cols(label_width => 180, left_text_margin => 18), 23, +is($updated_layout->get_text_wrap_cols(label_width => 180, left_text_margin => 18), 21, "Layout->get_text_wrap_cols()"); # Testing Layout->delete() my $del_results = $updated_layout->delete(); -ok($del_results ne -1, "Layout->delete() success"); +ok( ! defined($del_results) , "Layout->delete() success"); 1; -- 1.7.10.4