Skip to main content

run_tests

Function run_tests 

Source
pub fn run_tests(
    code: &str,
    chunk_name: &str,
    search_paths: &[&str],
) -> Result<TestSummary, String>
Expand description

Run Lua test code with the lust framework pre-loaded.

Creates a fresh Lua VM, registers lust and test doubles, executes code, and returns the structured test summary.

search_paths is prepended to package.path so that require can resolve project-specific modules. Pass &[] when no extra paths are needed.

Lua’s print is replaced with a no-op to prevent stdout pollution. Callers who need console output should use register on their own Lua instance where print remains intact.