[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
master
Josh Berdine 3 years ago committed by Facebook GitHub Bot
parent 099af312bb
commit abe8ba847a

@ -453,12 +453,14 @@ let write_html ranges rows chan =
( match ss with ( match ss with
| [] -> Printf.fprintf ppf ">" | [] -> Printf.fprintf ppf ">"
| ss -> | ss ->
List.iter ss ~f:(fun s -> if
List.exists ss ~f:(fun s ->
match (s : Report.status) with match (s : Report.status) with
| Safe _ | Unsafe _ | Ok -> | Safe _ | Unsafe _ | Ok -> false
Printf.fprintf ppf ">%a" pf_status s | _ -> true )
| _ -> Printf.fprintf ppf "class=\"regress\">%a" pf_status s ) then Printf.fprintf ppf " class=\"regress\"" ;
) ; Printf.fprintf ppf ">%s"
(Format.asprintf "%a" (List.pp " " Report.pp_status) ss) ) ;
Printf.fprintf ppf "</td>\n" Printf.fprintf ppf "</td>\n"
in in
let statd ppf = function let statd ppf = function

Loading…
Cancel
Save