This commit is contained in:
parent
aa2ff7b2f0
commit
2f3113f55d
11742 changed files with 1223940 additions and 0 deletions
22
unikernel/duniverse/ocaml-h1/lib_test/test_version.ml
Normal file
22
unikernel/duniverse/ocaml-h1/lib_test/test_version.ml
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
open H1
|
||||
open Version
|
||||
|
||||
let v1_0 = { major = 1; minor = 0 }
|
||||
let v1_1 = { major = 1; minor = 1 }
|
||||
|
||||
let test_compare () =
|
||||
Alcotest.(check int) "compare v1_1 v1_0" (compare v1_1 v1_0) 1;
|
||||
Alcotest.(check int) "compare v1_1 v1_1" (compare v1_1 v1_1) 0;
|
||||
Alcotest.(check int) "compare v1_0 v1_0" (compare v1_0 v1_0) 0;
|
||||
Alcotest.(check int) "compare v1_0 v1_1" (compare v1_0 v1_1) (-1);
|
||||
;;
|
||||
|
||||
let test_to_string () =
|
||||
Alcotest.(check string) "to_string v1_1" (to_string v1_1) "HTTP/1.1";
|
||||
Alcotest.(check string) "to_string v1_0" (to_string v1_0) "HTTP/1.0";
|
||||
;;
|
||||
|
||||
let tests =
|
||||
[ "compare" , `Quick, test_compare
|
||||
; "to_string", `Quick, test_to_string
|
||||
]
|
||||
Loading…
Add table
Add a link
Reference in a new issue