-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmyTests.ml
34 lines (31 loc) · 1.1 KB
/
myTests.ml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
open Runner
open Expr
open Printf
open OUnit2
(* Fill in `myTestList` with your own tests. There are two ways to add a test:
*
* (1) By adding the code of the program as a string. In this case, add an entry
* of this form in `myTestList`:
*
* t <test_name> <program_code> <result>
*
* (2) By adding a test inside the 'input/' folder and adding an entry for it
* in `myTestList`. The entry in this case should be:
*
* t_file <test_name> <file_name> <result>
*
* Where name is the name of the file inside 'input/' with the extension
* ".ana". For example:
*
* t_file "myTest" "mytest.ana" "6";
*)
let t_i name program expected args = name>::test_run program name expected args
let t name program expected = name>::test_run program name expected []
let terr_i name program expected args = name>::test_err program name expected args
let t_err name program expected = name>::test_err program name expected []
let t_parse name program expected =
name>::(fun _ -> assert_equal expected (Runner.parse_string program));;
let myTestList =
[ (* Fill in your tests here: *)
]
;;