Skip to content

Commit f8ed33a

Browse files
committed
Fix tests
1 parent 2595589 commit f8ed33a

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

tests/luau/require.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -225,14 +225,19 @@ async fn test_async_require() -> Result<()> {
225225
Ok(())
226226
})?,
227227
)?;
228+
lua.globals().set("tmp_dir", temp_dir.path().to_str().unwrap())?;
229+
lua.globals().set(
230+
"curr_dir_components",
231+
std::env::current_dir().unwrap().components().count(),
232+
)?;
228233

229234
lua.load(
230235
r#"
231-
local result = require("./async_chunk")
236+
local path_to_root = string.rep("/..", curr_dir_components - 1)
237+
local result = require(`.{path_to_root}{tmp_dir}/async_chunk`)
232238
assert(result == "result_after_async_sleep")
233239
"#,
234240
)
235-
.set_name(format!("@{}", temp_dir.path().join("require.rs").display()))
236241
.exec_async()
237242
.await
238243
}

0 commit comments

Comments
 (0)