Add module loader and related tests

Introduce `ModuleLoader` to handle `#use` directives and dependency
resolution. This involves adding `tempfile` dependency, modifying
`Cargo.toml` and `Cargo.lock`, creating a new `module_loader.rs` file,
and updating `environment.rs` to use the new module.

Also, add comprehensive tests for `Diagnostics::format_errors`,
`CompilationResult`, and the new `ModuleLoader` functionality. These
tests cover various scenarios including empty diagnostics, multiple
errors, error formatting, compilation success/failure, and complex
dependency loading with topological ordering and search path resolution.
This commit is contained in:
2026-03-27 15:08:28 +01:00
parent 636f5a1814
commit 1f0208af95
8 changed files with 457 additions and 123 deletions
Generated
+1
View File
@@ -2019,6 +2019,7 @@ dependencies = [
"regex",
"rmcp",
"serde",
"tempfile",
"tokio",
]