File: expr05lexico_test.ml

package info (click to toggle)
ocaml-visitors 20200210-3
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 1,896 kB
  • sloc: ml: 4,077; makefile: 44; sh: 18
file content (11 lines) | stat: -rw-r--r-- 462 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
open Expr02
open Expr05lexico

let () =
  assert (compare (EConst 1) (EConst 2) = -1);
  assert (compare (EConst 1) (EAdd (EConst 0, EConst 0)) = -1);
  assert (compare (EAdd (EConst 0, EConst 0)) (EConst 1) = +1);
  assert (compare (EAdd (EConst 0, EConst 0)) (EAdd (EConst 0, EConst 0)) = 0);
  assert (compare (EAdd (EConst 0, EConst 0)) (EAdd (EConst 0, EConst 1)) = -1);
  assert (compare (EAdd (EConst 1, EConst 0)) (EAdd (EConst 0, EConst 1)) = +1);
  ()