mirror of
https://github.com/c-cube/ocaml-containers.git
synced 2025-12-08 04:05:30 -05:00
Rewrite a test so that it passes also on the bytecode backend
Rewrite a test to shorten the lexical scope of the string it builds because, in the bytecode backend, a variable is deemed live at least as long as its lexical scope. Reference: https://github.com/ocaml/ocaml/pull/10071
This commit is contained in:
parent
d1de46c7a9
commit
1367d5b855
1 changed files with 4 additions and 3 deletions
|
|
@ -612,10 +612,11 @@ q
|
|||
|
||||
(* check it frees memory properly *)
|
||||
t @@ fun () ->
|
||||
let s = "coucou" ^ "lol" in
|
||||
let w = Weak.create 1 in
|
||||
Weak.set w 0 (Some s);
|
||||
let v = of_list [ "a"; s ] in
|
||||
let v =
|
||||
let s = "coucou" ^ "lol" in
|
||||
Weak.set w 0 (Some s) ;
|
||||
of_list [ "a"; s ] in
|
||||
filter_in_place (fun s -> String.length s <= 1) v;
|
||||
assert_equal 1 (length v);
|
||||
assert_equal "a" (get v 0);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue