mirror of
https://github.com/nushell/nushell.git
synced 2025-06-30 14:40:06 +02:00
Change parser cwd when running a file (#7134)
* Change parser cwd when running a file * Add test * Add missing file
This commit is contained in:
@ -2,6 +2,15 @@ use nu_test_support::fs::Stub::FileWithContentToBeTrimmed;
|
||||
use nu_test_support::playground::Playground;
|
||||
use nu_test_support::{nu, pipeline};
|
||||
|
||||
#[test]
|
||||
fn source_file_relative_to_file() {
|
||||
let actual = nu!(cwd: "tests/parsing/samples", r#"
|
||||
nu source_file_relative.nu
|
||||
"#);
|
||||
|
||||
assert_eq!(actual.out, "5");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn run_nu_script_single_line() {
|
||||
let actual = nu!(cwd: "tests/parsing/samples", r#"
|
||||
|
1
tests/parsing/samples/source_file_relative.nu
Normal file
1
tests/parsing/samples/source_file_relative.nu
Normal file
@ -0,0 +1 @@
|
||||
source single_line.nu
|
Reference in New Issue
Block a user