File: t_bool.ml

package info (click to toggle)
ocaml-containers 3.15%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 2,412 kB
  • sloc: ml: 33,221; sh: 122; makefile: 32
file content (15 lines) | stat: -rw-r--r-- 481 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
open CCBool
module T = (val Containers_testlib.make ~__FILE__ ())
include T;;

eq 1 (to_int true);;
eq 0 (to_int false);;
eq true (of_int 1);;
eq false (of_int 0);;
eq true (of_int 42);;
eq true (of_int max_int);;
eq true (of_int min_int);;
eq (Some "true") (if_then (Fun.const "true") true);;
eq None (if_then (Fun.const "true") false);;
eq "true" (if_then_else (Fun.const "true") (Fun.const "false") true);;
eq "false" (if_then_else (Fun.const "true") (Fun.const "false") false)