diff options
-rw-r--r-- | Makefile | 2 | ||||
-rw-r--r-- | src/ExtractToFStar.ml | 7 |
2 files changed, 5 insertions, 4 deletions
@@ -19,7 +19,7 @@ build: .PHONY: build-run build-run: build dune exec -- src/main.exe $(CFIM_TEST_FILE1) -dest $(DEST_DIR) -test-units -test-trans-units > tests/trace_current.txt - dune exec -- src/main.exe $(CFIM_TEST_FILE2) -dest $(DEST_DIR) + dune exec -- src/main.exe $(CFIM_TEST_FILE2) -dest $(DEST_DIR) -test-trans-units # Build the project and run the executable, then check that the behaviour # of the interpreter didn't change by comparing the newly generated trace diff --git a/src/ExtractToFStar.ml b/src/ExtractToFStar.ml index 5bf33677..0c77f48b 100644 --- a/src/ExtractToFStar.ml +++ b/src/ExtractToFStar.ml @@ -1026,7 +1026,7 @@ let extract_unit_test_if_unit_fun (ctx : extraction_ctx) (fmt : F.formatter) let sg = def.signature in if sg.type_params = [] - && sg.inputs = [ unit_ty ] + && (sg.inputs = [ unit_ty ] || sg.inputs = []) && sg.outputs = [ mk_result_ty unit_ty ] then ( (* Add a break before *) @@ -1045,8 +1045,9 @@ let extract_unit_test_if_unit_fun (ctx : extraction_ctx) (fmt : F.formatter) F.pp_print_string fmt "("; let fun_name = ctx_get_local_function def.def_id def.back_id ctx in F.pp_print_string fmt fun_name; - F.pp_print_space fmt (); - F.pp_print_string fmt "()"; + if sg.inputs <> [] then ( + F.pp_print_space fmt (); + F.pp_print_string fmt "()"); F.pp_print_space fmt (); F.pp_print_string fmt "="; F.pp_print_space fmt (); |