mirror of
https://github.com/nushell/nushell.git
synced 2025-08-09 20:47:44 +02:00
fix overlay use with directory
This commit is contained in:
@ -1412,8 +1412,8 @@ fn overlay_help_no_error() {
|
|||||||
#[test]
|
#[test]
|
||||||
fn test_overlay_use_with_printing_file_pwd() {
|
fn test_overlay_use_with_printing_file_pwd() {
|
||||||
Playground::setup("use_with_printing_file_pwd", |dirs, nu| {
|
Playground::setup("use_with_printing_file_pwd", |dirs, nu| {
|
||||||
let file = dirs.test().join("mod.nu");
|
let file = dirs.test().join("foo").join("mod.nu");
|
||||||
nu.with_files(&[FileWithContent(
|
nu.mkdir("foo").with_files(&[FileWithContent(
|
||||||
file.as_os_str().to_str().unwrap(),
|
file.as_os_str().to_str().unwrap(),
|
||||||
r#"
|
r#"
|
||||||
export-env {
|
export-env {
|
||||||
@ -1424,18 +1424,18 @@ fn test_overlay_use_with_printing_file_pwd() {
|
|||||||
|
|
||||||
let actual = nu!(
|
let actual = nu!(
|
||||||
cwd: dirs.test(),
|
cwd: dirs.test(),
|
||||||
"overlay use ."
|
"overlay use foo"
|
||||||
);
|
);
|
||||||
|
|
||||||
assert_eq!(actual.out, dirs.test().to_string_lossy());
|
assert_eq!(actual.out, dirs.test().join("foo").to_string_lossy());
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_overlay_use_with_printing_current_file() {
|
fn test_overlay_use_with_printing_current_file() {
|
||||||
Playground::setup("use_with_printing_current_file", |dirs, nu| {
|
Playground::setup("use_with_printing_current_file", |dirs, nu| {
|
||||||
let file = dirs.test().join("mod.nu");
|
let file = dirs.test().join("foo").join("mod.nu");
|
||||||
nu.with_files(&[FileWithContent(
|
nu.mkdir("foo").with_files(&[FileWithContent(
|
||||||
file.as_os_str().to_str().unwrap(),
|
file.as_os_str().to_str().unwrap(),
|
||||||
r#"
|
r#"
|
||||||
export-env {
|
export-env {
|
||||||
@ -1446,9 +1446,12 @@ fn test_overlay_use_with_printing_current_file() {
|
|||||||
|
|
||||||
let actual = nu!(
|
let actual = nu!(
|
||||||
cwd: dirs.test(),
|
cwd: dirs.test(),
|
||||||
"overlay use ."
|
"overlay use foo"
|
||||||
);
|
);
|
||||||
|
|
||||||
assert_eq!(actual.out, dirs.test().join("mod.nu").to_string_lossy());
|
assert_eq!(
|
||||||
|
actual.out,
|
||||||
|
dirs.test().join("foo").join("mod.nu").to_string_lossy()
|
||||||
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user