tracks/ocaml/tools/test-generator/src/test_generator.ml in trackler-2.0.1.1 vs tracks/ocaml/tools/test-generator/src/test_generator.ml in trackler-2.0.1.2

- old
+ new

@@ -30,13 +30,18 @@ template >>= fun template -> cases >>= fun cs -> let substs = Result.ok_or_failwith @@ generate_code (fixup ~stringify:parameter_to_string ~slug) (edit ~slug) template.template cs in Result.return (fill template substs) +(* Hack - right now it's generating -1L, but Ocaml needs (-1L) *) +let final_fixup (s: string): string = + String.substr_replace_all s ~pattern:"-1L" ~with_:"(-1L)" + let output_tests (files: (string * content * content) list) (output_folder: string): unit = let output_filepath name = output_folder ^ "/" ^ name ^ "/test.ml" in let output1 (slug,t,c) = let code = Result.ok_or_failwith @@ generate_code slug t c in + let code = final_fixup code in Out_channel.write_all (output_filepath slug) code in List.iter files ~f:output1 let run ~(templates_folder: string) ~(canonical_data_folder: string) ~(output_folder: string) = let template_files = find_template_files templates_folder in