We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2595589 commit f8ed33aCopy full SHA for f8ed33a
tests/luau/require.rs
@@ -225,14 +225,19 @@ async fn test_async_require() -> Result<()> {
225
Ok(())
226
})?,
227
)?;
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
+ )?;
233
234
lua.load(
235
r#"
- 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`)
238
assert(result == "result_after_async_sleep")
239
"#,
240
)
- .set_name(format!("@{}", temp_dir.path().join("require.rs").display()))
241
.exec_async()
242
.await
243
}
0 commit comments