test: enhance OCaml test case with module and type definitions

This commit is contained in:
Paul Gauthier (aider) 2024-11-27 06:51:53 -08:00
parent 203128d935
commit 00f79fecd0

View file

@ -451,8 +451,27 @@ module.exports = {
), ),
"ocaml": ( "ocaml": (
"test.ml", "test.ml",
'let greet name =\n Printf.printf "Hello, %s!\\n" name\n', """(* Module definition *)
"greet", # Key symbol to check module Greeter = struct
type person = {
name: string;
age: int
}
let create_person name age =
{name; age}
let greet person =
Printf.printf "Hello, %s! You are %d years old.\\n"
person.name person.age
end
(* Outside the module *)
let () =
let person = Greeter.create_person "Alice" 30 in
Greeter.greet person
""",
"Greeter", # Key symbol to check
), ),
"php": ( "php": (
"test.php", "test.php",