mirror of
https://github.com/nushell/nushell.git
synced 2025-08-09 15:55:19 +02:00
Allow save to accept a list of strings (#4743)
This commit is contained in:
@ -49,6 +49,24 @@ fn writes_out_csv() {
|
||||
})
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn writes_out_list() {
|
||||
Playground::setup("save_test_3", |dirs, sandbox| {
|
||||
sandbox.with_files(vec![]);
|
||||
|
||||
let expected_file = dirs.test().join("list_sample.txt");
|
||||
|
||||
nu!(
|
||||
cwd: dirs.root(),
|
||||
r#"echo [a b c d] | save save_test_3/list_sample.txt"#,
|
||||
);
|
||||
|
||||
let actual = file_contents(expected_file);
|
||||
println!("{actual}");
|
||||
assert_eq!(actual, "a\nb\nc\nd\n")
|
||||
})
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn save_append_will_create_file_if_not_exists() {
|
||||
Playground::setup("save_test_3", |dirs, sandbox| {
|
||||
|
Reference in New Issue
Block a user