File: random.t

package info (click to toggle)
bisect-ppx 2.8.3%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 1,352 kB
  • sloc: ml: 3,575; javascript: 813; makefile: 226; sh: 140
file content (17 lines) | stat: -rw-r--r-- 558 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
Bisect's runtime does not clobber the global random number generator state.

  $ echo "(lang dune 2.7)" > dune-project
  $ cat > dune <<'EOF'
  > (executable
  >  (name random_test)
  >  (instrumentation (backend bisect_ppx)))
  > EOF
  $ cat > random_test.ml <<'EOF'
  > let () =
  >   Random.int 1000 |> string_of_int |> print_endline
  > EOF
  $ dune exec ./random_test.exe > pristine
  $ dune exec ./random_test.exe --instrument-with bisect_ppx > 1
  $ dune exec ./random_test.exe --instrument-with bisect_ppx > 2
  $ diff pristine 1
  $ diff pristine 2