mirror of
https://github.com/nushell/nushell.git
synced 2025-08-14 02:09:04 +02:00
Further edits to help messages (#6913)
This commit is contained in:
@ -208,7 +208,7 @@ fn errors_fetching_by_index_out_of_bounds() {
|
||||
fn quoted_column_access() {
|
||||
let actual = nu!(
|
||||
cwd: "tests/fixtures/formats",
|
||||
r#"echo '[{"foo bar": {"baz": 4}}]' | from json | get "foo bar".baz.0 "#
|
||||
r#"'[{"foo bar": {"baz": 4}}]' | from json | get "foo bar".baz.0 "#
|
||||
);
|
||||
|
||||
assert_eq!(actual.out, "4");
|
||||
|
@ -12,7 +12,7 @@ fn writes_out_csv() {
|
||||
|
||||
nu!(
|
||||
cwd: dirs.root(),
|
||||
r#"echo [[name, version, description, license, edition]; [nu, "0.14", "A new type of shell", "MIT", "2018"]] | save save_test_2/cargo_sample.csv"#,
|
||||
r#"[[name, version, description, license, edition]; [nu, "0.14", "A new type of shell", "MIT", "2018"]] | save save_test_2/cargo_sample.csv"#,
|
||||
);
|
||||
|
||||
let actual = file_contents(expected_file);
|
||||
@ -30,7 +30,7 @@ fn writes_out_list() {
|
||||
|
||||
nu!(
|
||||
cwd: dirs.root(),
|
||||
r#"echo [a b c d] | save save_test_3/list_sample.txt"#,
|
||||
r#"[a b c d] | save save_test_3/list_sample.txt"#,
|
||||
);
|
||||
|
||||
let actual = file_contents(expected_file);
|
||||
@ -48,7 +48,7 @@ fn save_append_will_create_file_if_not_exists() {
|
||||
|
||||
nu!(
|
||||
cwd: dirs.root(),
|
||||
r#"echo hello | save --raw --append save_test_3/new-file.txt"#,
|
||||
r#"'hello' | save --raw --append save_test_3/new-file.txt"#,
|
||||
);
|
||||
|
||||
let actual = file_contents(expected_file);
|
||||
@ -74,7 +74,7 @@ fn save_append_will_not_overwrite_content() {
|
||||
|
||||
nu!(
|
||||
cwd: dirs.root(),
|
||||
r#"echo world | save --append save_test_4/new-file.txt"#,
|
||||
r#"'world' | save --append save_test_4/new-file.txt"#,
|
||||
);
|
||||
|
||||
let actual = file_contents(expected_file);
|
||||
|
@ -16,7 +16,7 @@ fn filters_by_unit_size_comparison() {
|
||||
fn filters_with_nothing_comparison() {
|
||||
let actual = nu!(
|
||||
cwd: "tests/fixtures/formats",
|
||||
r#"echo '[{"foo": 3}, {"foo": null}, {"foo": 4}]' | from json | get foo | compact | where $it > 1 | math sum"#
|
||||
r#"'[{"foo": 3}, {"foo": null}, {"foo": 4}]' | from json | get foo | compact | where $it > 1 | math sum"#
|
||||
);
|
||||
|
||||
assert_eq!(actual.out, "7");
|
||||
@ -26,7 +26,7 @@ fn filters_with_nothing_comparison() {
|
||||
fn where_in_table() {
|
||||
let actual = nu!(
|
||||
cwd: "tests/fixtures/formats",
|
||||
r#"echo '[{"name": "foo", "size": 3}, {"name": "foo", "size": 2}, {"name": "bar", "size": 4}]' | from json | where name in ["foo"] | get size | math sum"#
|
||||
r#"'[{"name": "foo", "size": 3}, {"name": "foo", "size": 2}, {"name": "bar", "size": 4}]' | from json | where name in ["foo"] | get size | math sum"#
|
||||
);
|
||||
|
||||
assert_eq!(actual.out, "5");
|
||||
@ -36,7 +36,7 @@ fn where_in_table() {
|
||||
fn where_not_in_table() {
|
||||
let actual = nu!(
|
||||
cwd: "tests/fixtures/formats",
|
||||
r#"echo '[{"name": "foo", "size": 3}, {"name": "foo", "size": 2}, {"name": "bar", "size": 4}]' | from json | where name not-in ["foo"] | get size | math sum"#
|
||||
r#"'[{"name": "foo", "size": 3}, {"name": "foo", "size": 2}, {"name": "bar", "size": 4}]' | from json | where name not-in ["foo"] | get size | math sum"#
|
||||
);
|
||||
|
||||
assert_eq!(actual.out, "4");
|
||||
|
Reference in New Issue
Block a user