mirror of
https://github.com/nushell/nushell.git
synced 2025-08-09 19:27:44 +02:00
Fix scoped overlay use
not finding a module (#6474)
* Add source-env test for dynamic path * Use correct module ID for env overlay imports * Remove parser check from "overlay list" It would cause unnecessary errors from some inner scope if some overlay module was also defined in some inner scope. * Restore Cargo.lock back * Remove comments
This commit is contained in:
@ -141,3 +141,17 @@ fn sources_unicode_file_in_unicode_dir_with_spaces_2() {
|
||||
fn sources_unicode_file_in_non_utf8_dir() {
|
||||
// How do I create non-UTF-8 path???
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn can_source_dynamic_path() {
|
||||
Playground::setup("can_source_dynamic_path", |dirs, sandbox| {
|
||||
let foo_file = "foo.nu";
|
||||
|
||||
sandbox.with_files(vec![FileWithContent(&foo_file, "echo foo")]);
|
||||
|
||||
let cmd = format!("let file = `{}`; source-env $file", foo_file);
|
||||
let actual = nu!(cwd: dirs.test(), &cmd);
|
||||
|
||||
assert_eq!(actual.out, "foo");
|
||||
});
|
||||
}
|
||||
|
Reference in New Issue
Block a user