mirror of
https://github.com/nushell/nushell.git
synced 2025-08-19 08:01:30 +02:00
Add subcommands. Switch from-* and to-* to them (#1708)
This commit is contained in:
@@ -8,8 +8,8 @@ fn table_to_json_text_and_from_json_text_back_into_table() {
|
||||
cwd: "tests/fixtures/formats", pipeline(
|
||||
r#"
|
||||
open sgml_description.json
|
||||
| to-json
|
||||
| from-json
|
||||
| to json
|
||||
| from json
|
||||
| get glossary.GlossDiv.GlossList.GlossEntry.GlossSee
|
||||
| echo $it
|
||||
"#
|
||||
@@ -37,7 +37,7 @@ fn from_json_text_to_table() {
|
||||
|
||||
let actual = nu!(
|
||||
cwd: dirs.test(),
|
||||
"open katz.txt | from-json | get katz | get rusty_luck | count | echo $it"
|
||||
"open katz.txt | from json | get katz | get rusty_luck | count | echo $it"
|
||||
);
|
||||
|
||||
assert_eq!(actual, "4");
|
||||
@@ -61,7 +61,7 @@ fn from_json_text_recognizing_objects_independently_to_table() {
|
||||
cwd: dirs.test(), pipeline(
|
||||
r#"
|
||||
open katz.txt
|
||||
| from-json -o
|
||||
| from json -o
|
||||
| where name == "GorbyPuff"
|
||||
| get rusty_luck
|
||||
| echo $it
|
||||
@@ -90,8 +90,8 @@ fn table_to_json_text() {
|
||||
| lines
|
||||
| split-column "," name luck
|
||||
| pick name
|
||||
| to-json
|
||||
| from-json
|
||||
| to json
|
||||
| from json
|
||||
| nth 0
|
||||
| get name
|
||||
| echo $it
|
||||
|
Reference in New Issue
Block a user