Skip to content

Commit c1d3d90

Browse files
committed
Fix tests
1 parent cd845c9 commit c1d3d90

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

‎tests/hooks.rs‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#![cfg(not(feature = "luau"))]
22

3-
use std::panic::{AssertUnwindSafe, catch_unwind};
43
use std::sync::atomic::{AtomicI64, Ordering};
54
use std::sync::{Arc, Mutex};
65

@@ -114,7 +113,10 @@ fn test_error_within_hook() -> Result<()> {
114113
}
115114

116115
#[test]
116+
#[cfg(not(target_arch = "wasm32"))]
117117
fn test_panic_during_callback_traceback() -> Result<()> {
118+
use std::panic::{AssertUnwindSafe, catch_unwind};
119+
118120
let lua = Lua::new();
119121
if cfg!(feature = "luajit") && lua.set_memory_limit(0).is_err() {
120122
return Ok(());

‎tests/memory.rs‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ fn test_memory_limit() -> Result<()> {
5454
})?;
5555
let _refs: Vec<_> = (0..nrefs).map(|_| lua.globals()).collect();
5656
assert_eq!(f.call::<i32>(42)?, 42);
57+
lua.set_memory_limit(0)?;
5758
}
5859

5960
Ok(())
@@ -69,6 +70,7 @@ fn test_result_reference_exhaustion() -> Result<()> {
6970
.load("local t = {}; return function() return t, t end")
7071
.eval()?;
7172
f.call::<MultiValue>(())?; // Warm the call stack before limiting allocations.
73+
lua.gc_stop();
7274
lua.set_memory_limit(1)?;
7375

7476
let mut refs = Vec::new();

0 commit comments

Comments
 (0)