summaryrefslogtreecommitdiff
path: root/testsuite/tests/basic-more/function_in_ref.ml
blob: fd4446cbba7bd8b11f577c2de4403faf4fa2ba9c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
(* TEST
 include testing;
*)

let f x = x + 1
let g x = x - 1

let run () =
  let r = ref f in
  r := g;
  let n = !r 1 in
  assert(n = 0)