Skip to content

Commit

Permalink
Update switch test for Eio 1.0
Browse files Browse the repository at this point in the history
This matches the change to the same test in
ocaml-multicore/eio#684.
  • Loading branch information
talex5 committed Aug 23, 2024
1 parent f121725 commit fbb474a
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion dune-project
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
(description "An Eio scheduler suitable for JavaScript environments.")
(depends
(mdx (and (>= 2.4.1) :with-test))
(eio (>= 0.14))))
(eio (>= 1.0))))
(package
(name eio_brr)
(synopsis "Eio support for Brr")
Expand Down
2 changes: 1 addition & 1 deletion eio_js_backend.opam
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ bug-reports: "https://github.com/ocaml-multicore/eio_js/issues"
depends: [
"dune" {>= "3.9"}
"mdx" {>= "2.4.1" & with-test}
"eio" {>= "0.14"}
"eio" {>= "1.0"}
"odoc" {with-doc}
]
build: [
Expand Down
10 changes: 8 additions & 2 deletions lib_eio_js_backend/tests/switch.md
Original file line number Diff line number Diff line change
Expand Up @@ -377,8 +377,13 @@ Using switch from inside release handler:
);
Switch.on_release sw (fun () ->
Fiber.fork ~sw (fun () ->
Switch.on_release sw (fun () -> traceln "Late release");
traceln "Starting release 2";
begin
try
Switch.on_release sw (fun () -> traceln "Immediate release");
with Invalid_argument msg ->
traceln "on_release refused: %s" msg
end;
Fiber.yield ();
traceln "Finished release 2"
);
Expand All @@ -387,10 +392,11 @@ Using switch from inside release handler:
);;
+Main fiber done
+Starting release 2
+Immediate release
+on_release refused: Switch finished!
+Starting release 1
+Finished release 2
+Finished release 1
+Late release
- : unit = ()
```

Expand Down

0 comments on commit fbb474a

Please sign in to comment.