mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-22 21:34:59 +00:00
test: enhance OCaml test case with module and type definitions
This commit is contained in:
parent
203128d935
commit
00f79fecd0
1 changed files with 21 additions and 2 deletions
|
@ -451,8 +451,27 @@ module.exports = {
|
|||
),
|
||||
"ocaml": (
|
||||
"test.ml",
|
||||
'let greet name =\n Printf.printf "Hello, %s!\\n" name\n',
|
||||
"greet", # Key symbol to check
|
||||
"""(* Module definition *)
|
||||
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": (
|
||||
"test.php",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue