Add all the assignment code.
Signed-off-by: jmug <u.g.a.mariano@gmail.com>
This commit is contained in:
parent
58c6b1f81c
commit
cfe502c598
1277 changed files with 48709 additions and 1 deletions
57
hw2/lib/util/assert.mli
Normal file
57
hw2/lib/util/assert.mli
Normal file
|
|
@ -0,0 +1,57 @@
|
|||
(* 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. *)
|
||||
|
||||
exception Timeout
|
||||
|
||||
(* 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_eqfs : (unit -> string) -> string -> assertion
|
||||
|
||||
val assert_fail : assertion
|
||||
|
||||
val timeout_assert : int -> assertion -> assertion
|
||||
|
||||
val timeout_test : int -> assertion test -> assertion test
|
||||
|
||||
val timeout_suite : int -> suite -> suite
|
||||
|
||||
(***************************)
|
||||
(* 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
|
||||
Loading…
Add table
Add a link
Reference in a new issue