File size: 597 Bytes
24e07f8
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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

module Main = struct
    open OUnit2

    (* Program start *)

    (* Program end *)

    (* Test cases *)
    
let test1 _ = assert_equal "Flush" (bestHand [13;2;3;1;9] ["a";"a";"a";"a";"a"])

let test2 _ = assert_equal "Three of a Kind" (bestHand [4;4;2;4;4] ["d";"a";"a";"b";"c"])

let test3 _ = assert_equal "Pair" (bestHand [10;10;2;12;9] ["a";"b";"c";"a";"d"])


    (* Grouping test cases *)
    let suite = "Test Suite for bestHand" >::: [
        
  "test1" >:: test1;
  "test2" >:: test2;
  "test3" >:: test3;
    ]


    (* Running the tests *)
    let () = run_test_tt_main suite
end