Revert PRs for 0.99.1 patch (#14119)

# Description

Temporarily reverts PRs merged after the 0.99.1 bump.
This commit is contained in:
Ian Manske
2024-10-17 19:51:14 -07:00
committed by GitHub
parent e735bd475f
commit 28b6db115a
33 changed files with 287 additions and 782 deletions

View File

@ -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]

View File

@ -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\":[]}"
);
}