-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathassert.mli
47 lines (30 loc) · 1.17 KB
/
assert.mli
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
35
36
37
38
39
40
41
42
43
44
45
46
47
(* CIS341 Assertion Testing and Grading Infrastructure *)
(* Author: Steve Zdancewic *)
(* Do NOT modify this file -- we will overwrite it *)
(* with our own version when testing your code. *)
(* An assertion is just a unit->unit function that either *)
(* succeeds silently or throws an Failure exception. *)
type assertion = (unit -> unit)
type 'a test =
| GradedTest of string * int * (string * 'a) list
| Test of string * (string * 'a) list
type suite = (assertion test) list
(**************)
(* Assertions *)
val assert_eq : 'a -> 'a -> assertion
val assert_eqf : (unit -> 'a) -> 'a -> assertion
val assert_fail : assertion
(***************************)
(* Generating Test Results *)
type result =
| Pass
| Fail of string
type outcome = (result test) list
val run_assertion : assertion -> result
val run_test : assertion test -> result test
val run_suite : suite -> outcome
(***********************)
(* Reporting functions *)
val result_test_to_string : string -> result test -> string
(* val get_results result test -> (string * int * int * int * float * int * int) *)
val outcome_to_string :outcome -> string