mirror of
https://github.com/nushell/nushell.git
synced 2025-06-30 14:40:06 +02:00
Allow "export-env" parsing in modules (#6382)
* Allow "export-env" parsing in modules * Fmt * Add test for importing module's environment
This commit is contained in:
@ -151,3 +151,23 @@ fn parse_file_relative_to_parsed_file_dont_use_cwd_2() {
|
||||
assert!(actual.err.contains("File not found"));
|
||||
})
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn parse_export_env_in_module() {
|
||||
let actual = nu!(cwd: "tests/parsing/samples",
|
||||
r#"
|
||||
module spam { export-env { } }
|
||||
"#);
|
||||
|
||||
assert!(actual.err.is_empty());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn parse_export_env_missing_block() {
|
||||
let actual = nu!(cwd: "tests/parsing/samples",
|
||||
r#"
|
||||
module spam { export-env }
|
||||
"#);
|
||||
|
||||
assert!(actual.err.contains("missing block"));
|
||||
}
|
||||
|
Reference in New Issue
Block a user