diff options
author | Damien Doligez <damien.doligez-inria.fr> | 2002-11-07 17:57:23 +0000 |
---|---|---|
committer | Damien Doligez <damien.doligez-inria.fr> | 2002-11-07 17:57:23 +0000 |
commit | 2b633bf048b2b81146d9245bf706953998eacc47 (patch) | |
tree | aead00c80f96d4ce1362965524a0981067e2fe91 /test/Moretest | |
parent | fb251eceb3aa04a110937efbdce364dd6e86621c (diff) |
amelioration de let rec
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@5252 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
Diffstat (limited to 'test/Moretest')
-rw-r--r-- | test/Moretest/recvalues.ml | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/test/Moretest/recvalues.ml b/test/Moretest/recvalues.ml index f2b88923c..c00ced827 100644 --- a/test/Moretest/recvalues.ml +++ b/test/Moretest/recvalues.ml @@ -16,11 +16,23 @@ let _ = else print_string "Test 2: FAILED\n"; let rec z = (Gc.minor(); (one, one+1)) :: z in (* Trash the minor generation *) - for i = 0 to 50000 do ref 0 done; + for i = 0 to 50000 do ignore (ref 0) done; if match z with (1,2) :: z' -> z == z' | _ -> false then print_string "Test 3: passed\n" else print_string "Test 3: FAILED\n"; - exit 0 +;; +let rec s = "bar" +and idx = 1 +and x1 = let f x = Printf.printf "%s\n" x in f "foo"; s, x4 +and x2 = [| x1; x1 |] +and x3 = (fun () -> fst (x2.(idx))) :: x3 +and x4 = {contents = x3} +;; + +Gc.minor ();; +if (List.hd (!(snd (x2.(0))))) () == s +then print_string "Test 4: passed\n" +else print_string "Test 4: FAILED\n" |