This commit is contained in:
parent
aa2ff7b2f0
commit
2f3113f55d
11742 changed files with 1223940 additions and 0 deletions
24
unikernel/duniverse/base/test/test_sign_or_nan.ml
Normal file
24
unikernel/duniverse/base/test/test_sign_or_nan.ml
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
open! Import
|
||||
open! Sign_or_nan
|
||||
|
||||
let%test "of_int" = of_int 37 = Pos && of_int (-22) = Neg && of_int 0 = Zero
|
||||
|
||||
let%expect_test ("hash coherence" [@tags "64-bits-only"]) =
|
||||
check_hash_coherence [%here] (module Sign_or_nan) all;
|
||||
[%expect {| |}]
|
||||
;;
|
||||
|
||||
let%expect_test "to_string_hum" =
|
||||
List.iter all ~f:(fun t ->
|
||||
let string = to_string_hum t in
|
||||
print_endline string;
|
||||
match to_sign_exn t with
|
||||
| exception _ -> ()
|
||||
| sign -> require_equal [%here] (module String) string (Sign.to_string_hum sign));
|
||||
[%expect {|
|
||||
negative
|
||||
zero
|
||||
positive
|
||||
not-a-number
|
||||
|}]
|
||||
;;
|
||||
Loading…
Add table
Add a link
Reference in a new issue