From abe8ba847af9e0673aa441808580d4d54285d64b Mon Sep 17 00:00:00 2001 From: Josh Berdine Date: Mon, 28 Jun 2021 03:34:00 -0700 Subject: [PATCH] [sledge] Fix minor bug in test report generation Summary: Broken html could be generated if there were multiple status entries for a single test. Reviewed By: ngorogiannis Differential Revision: D28907807 fbshipit-source-id: 5fcb30b5f --- sledge/report/sledge_report.ml | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/sledge/report/sledge_report.ml b/sledge/report/sledge_report.ml index 85327dc49..5257fbbd9 100644 --- a/sledge/report/sledge_report.ml +++ b/sledge/report/sledge_report.ml @@ -453,12 +453,14 @@ let write_html ranges rows chan = ( match ss with | [] -> Printf.fprintf ppf ">" | ss -> - List.iter ss ~f:(fun s -> - match (s : Report.status) with - | Safe _ | Unsafe _ | Ok -> - Printf.fprintf ppf ">%a" pf_status s - | _ -> Printf.fprintf ppf "class=\"regress\">%a" pf_status s ) - ) ; + if + List.exists ss ~f:(fun s -> + match (s : Report.status) with + | Safe _ | Unsafe _ | Ok -> false + | _ -> true ) + then Printf.fprintf ppf " class=\"regress\"" ; + Printf.fprintf ppf ">%s" + (Format.asprintf "%a" (List.pp " " Report.pp_status) ss) ) ; Printf.fprintf ppf "\n" in let statd ppf = function