This commit is contained in:
WindSoilder 2024-06-20 15:48:22 +08:00
parent e9681fd5d5
commit 94479455a2

View File

@ -787,6 +787,20 @@ fn reload_submodules() {
];
let actual = nu!(cwd: dirs.test(), nu_repl_code(&inp));
assert_eq!(actual.out, "true");
// should also works if we use members directly.
sandbox.with_files(&[
FileWithContent("voice.nu", r#"export module animals.nu"#),
FileWithContent("animals.nu", "export def cat [] { 'meow'}"),
]);
let inp = [
"use voice.nu animals cat",
r#""export def cat [] {'woem'}" | save -f animals.nu"#,
"use voice.nu animals cat",
"(voice animals cat) == 'woem'",
];
let actual = nu!(cwd: dirs.test(), nu_repl_code(&inp));
assert_eq!(actual.out, "true");
});
}