From 1f6abc77c9d69c098e73583a61db188d8b9fe6c4 Mon Sep 17 00:00:00 2001 From: Julian Maurice Date: Thu, 7 Apr 2016 17:03:47 +0200 Subject: [PATCH] Bug 16224: Fix t/db_dependent/Reports_Guided.t This test: is( scalar @{ get_saved_reports( $report_ids[0] ) }, 1, "filter takes report id" ); can fail when $report_ids[0] is a substring of some saved_sql fields from other reports (reports that have a different id than $report_ids[0]). We can only be sure that get_saved_reports will return at least 1 report. --- t/db_dependent/Reports_Guided.t | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/t/db_dependent/Reports_Guided.t b/t/db_dependent/Reports_Guided.t index 4d89ebd..163a67d 100755 --- a/t/db_dependent/Reports_Guided.t +++ b/t/db_dependent/Reports_Guided.t @@ -70,8 +70,7 @@ like( $report_ids[2], '/^\d+$/', "Save_report returns an id for third" ); is( scalar @{ get_saved_reports() }, $count, "$count reports have been added" ); -is( scalar @{ get_saved_reports( $report_ids[0] ) }, - 1, "filter takes report id" ); +ok( 0 < scalar @{ get_saved_reports( $report_ids[0] ) }, "filter takes report id" ); #Test delete_report is (delete_report(),undef, "Without id delete_report returns undef"); -- 2.1.4