forked from extern/nushell
Revert PRs for 0.99.1 patch (#14119)
# Description Temporarily reverts PRs merged after the 0.99.1 bump.
This commit is contained in:
@ -23,33 +23,37 @@ fn groups() {
|
||||
|
||||
#[test]
|
||||
fn errors_if_given_unknown_column_name() {
|
||||
let sample = r#"{
|
||||
"nu": {
|
||||
"committers": [
|
||||
{"name": "Andrés N. Robalino"},
|
||||
{"name": "JT Turner"},
|
||||
{"name": "Yehuda Katz"}
|
||||
],
|
||||
"releases": [
|
||||
{"version": "0.2"}
|
||||
{"version": "0.8"},
|
||||
{"version": "0.9999999"}
|
||||
],
|
||||
"0xATYKARNU": [
|
||||
["Th", "e", " "],
|
||||
["BIG", " ", "UnO"],
|
||||
["punto", "cero"]
|
||||
]
|
||||
}
|
||||
}
|
||||
"#;
|
||||
let sample = r#"
|
||||
{
|
||||
"nu": {
|
||||
"committers": [
|
||||
{"name": "Andrés N. Robalino"},
|
||||
{"name": "JT Turner"},
|
||||
{"name": "Yehuda Katz"}
|
||||
],
|
||||
"releases": [
|
||||
{"version": "0.2"}
|
||||
{"version": "0.8"},
|
||||
{"version": "0.9999999"}
|
||||
],
|
||||
"0xATYKARNU": [
|
||||
["Th", "e", " "],
|
||||
["BIG", " ", "UnO"],
|
||||
["punto", "cero"]
|
||||
]
|
||||
}
|
||||
}
|
||||
"#;
|
||||
|
||||
let actual = nu!(pipeline(&format!(
|
||||
r#"'{sample}'
|
||||
| from json
|
||||
| group-by {{|| get nu.releases.missing_column }}"#
|
||||
r#"
|
||||
'{sample}'
|
||||
| from json
|
||||
| group-by {{|| get nu.releases.version }}
|
||||
"#
|
||||
)));
|
||||
assert!(actual.err.contains("cannot find column"));
|
||||
|
||||
assert!(actual.err.contains("can't convert list<string> to string"));
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
@ -126,20 +126,3 @@ fn prints_only_if_last_pipeline() {
|
||||
let actual = nu!("try { ['should not print'] | every 1 }; 'last value'");
|
||||
assert_eq!(actual.out, "last value");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn get_error_columns() {
|
||||
let actual = nu!(" try { non_existent_command } catch {|err| $err} | columns | to json -r");
|
||||
assert_eq!(
|
||||
actual.out,
|
||||
"[\"msg\",\"debug\",\"raw\",\"rendered\",\"json\"]"
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn get_json_error() {
|
||||
let actual = nu!("try { non_existent_command } catch {|err| $err} | get json | from json | update labels.span {{start: 0 end: 0}} | to json -r");
|
||||
assert_eq!(
|
||||
actual.out, "{\"msg\":\"External command failed\",\"labels\":[{\"text\":\"Command `non_existent_command` not found\",\"span\":{\"start\":0,\"end\":0}}],\"code\":\"nu::shell::external_command\",\"url\":null,\"help\":\"`non_existent_command` is neither a Nushell built-in or a known external command\",\"inner\":[]}"
|
||||
);
|
||||
}
|
||||
|
Reference in New Issue
Block a user