Suggest a column name in case one unknown column is supplied.

This commit is contained in:
Andrés N. Robalino
2019-10-22 00:00:06 -05:00
parent 0611f56776
commit f1630da2cc
4 changed files with 62 additions and 6 deletions

View File

@@ -31,6 +31,31 @@ fn group_by() {
})
}
#[test]
fn group_by_errors_if_unknown_column_name() {
Playground::setup("group_by_test_2", |dirs, sandbox| {
sandbox.with_files(vec![FileWithContentToBeTrimmed(
"los_tres_caballeros.csv",
r#"
first_name,last_name,rusty_luck,type
Andrés,Robalino,1,A
Jonathan,Turner,1,B
Yehuda,Katz,1,A
"#,
)]);
let actual = nu_error!(
cwd: dirs.test(), h::pipeline(
r#"
open los_tres_caballeros.csv
| group-by ttype
"#
));
assert!(actual.contains("Unknown column"));
})
}
#[test]
fn first_gets_first_rows_by_amount() {
Playground::setup("first_test_1", |dirs, sandbox| {