fix(overlay use): report errors in export-env (#16184)

- fixes #10242

# Tests + Formatting
Added 2 tests to confirm `use` and `overlay use` report errors in
`export-env` blocks.

---------

Co-authored-by: Bahex <17417311+Bahex@users.noreply.github.com>
This commit is contained in:
Bahex
2025-07-16 10:32:02 +03:00
committed by GitHub
parent db1ffe57d3
commit 00e9e0e6a9
3 changed files with 27 additions and 1 deletions

View File

@ -354,3 +354,15 @@ fn test_use_with_printing_current_file() {
assert_eq!(actual.out, dirs.test().join("mod.nu").to_string_lossy());
});
}
#[test]
fn report_errors_in_export_env() {
let actual = nu!(r#"
module spam {
export-env { error make -u {msg: "reported"} }
}
use spam
"#);
assert!(actual.err.contains("reported"));
}