From c12ff69abd830d566c4f311f483a64b27b8ee3e5 Mon Sep 17 00:00:00 2001 From: Guillaume Petiot Date: Tue, 5 Mar 2024 13:20:11 +0000 Subject: [PATCH] exec should be checked in update_errors --- lib/test/mdx_test.ml | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/lib/test/mdx_test.ml b/lib/test/mdx_test.ml index f898bdd1..fa185bba 100644 --- a/lib/test/mdx_test.ml +++ b/lib/test/mdx_test.ml @@ -195,10 +195,13 @@ let update_errors ~errors t = match t.Block.value with | OCaml v -> { t with value = OCaml (update_ocaml_value v) } | Include - ({ file_kind = Fk_ocaml ({ ocaml_value = Some v; _ } as fk); _ } as i) -> - let ocaml_value = Some (update_ocaml_value v) in - let file_kind = Block.Fk_ocaml { fk with ocaml_value } in - { t with value = Include { i with file_kind } } + ({ file_kind = Fk_ocaml ({ ocaml_value = Some v; exec; _ } as fk); _ } as + i) -> + if exec then + let ocaml_value = Some (update_ocaml_value v) in + let file_kind = Block.Fk_ocaml { fk with ocaml_value } in + { t with value = Include { i with file_kind } } + else t | _ -> assert false let update_include ~contents = function @@ -360,7 +363,7 @@ let run_exn ~non_deterministic ~silent_eval ~record_backtrace ~syntax ~silent | Include { file_included; - file_kind = Fk_ocaml { part_included; ocaml_value; exec; _ }; + file_kind = Fk_ocaml { part_included; ocaml_value; _ }; } -> assert (syntax <> Some Cram); let new_block = @@ -368,8 +371,7 @@ let run_exn ~non_deterministic ~silent_eval ~record_backtrace ~syntax ~silent in let updated_block = match ocaml_value with - | Some ocaml_value when exec -> - run_ocaml_value new_block ocaml_value + | Some ocaml_value -> run_ocaml_value new_block ocaml_value | _ -> new_block in Block.pp ?syntax ppf updated_block