File: t_either.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 (14 lines) | stat: -rw-r--r-- 397 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
open CCEither
module T = (val Containers_testlib.make ~__FILE__ ())
include T;;

eq (is_left (Left 1)) true;;
eq (is_left (Right 1)) false;;
eq (is_left (Left 1)) true;;
eq (is_left (Right 1)) false;;
eq (is_right (Left 1)) false;;
eq (is_right (Right 1)) true;;
eq (find_left (Left 1)) (Some 1);;
eq (find_left (Right 1)) None;;
eq (find_right (Left 1)) None;;
eq (find_right (Right 1)) (Some 1)