Skip to content

Commit 22b2560

Browse files
committed
Fix throw_catch_raise_catch test in old runtime
1 parent 8c16687 commit 22b2560

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

crates/tests/src/exception.rs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,13 @@ fn throw_catch_raise_catch() {
4242

4343
let exc = NSException::from_exception(res.unwrap_err().unwrap()).unwrap();
4444

45-
// Undesired: The inner pool _should_ have been drained on unwind, but
46-
// it isn't, see `rc::Pool::drain`.
47-
assert_eq!(exc.retainCount(), 2);
45+
if cfg!(all(target_os = "macos", target_arch = "x86")) {
46+
assert_eq!(exc.retainCount(), 1);
47+
} else {
48+
// Undesired: The inner pool _should_ have been drained on unwind,
49+
// but it isn't in newer runtimes, see docs on `rc::Pool::drain`.
50+
assert_eq!(exc.retainCount(), 2);
51+
}
4852
exc
4953
});
5054

0 commit comments

Comments
 (0)