port over from nushell the column flag for the length command (#617)

* port over from nushell the column flag for the length command

* fix clippy error

* refactor with the get_columns now centrally located
This commit is contained in:
Michael Angerman
2021-12-31 20:27:20 -08:00
committed by GitHub
parent f734995170
commit 5d58f68c59
2 changed files with 92 additions and 15 deletions

View File

@ -197,3 +197,16 @@ fn select() -> TestResult {
fn update_will_insert() -> TestResult {
run_test(r#"{} | update a b | get a"#, "b")
}
#[test]
fn length_for_columns() -> TestResult {
run_test(
r#"[[name,age,grade]; [bill,20,a] [a b c]] | length -c"#,
"3",
)
}
#[test]
fn length_for_rows() -> TestResult {
run_test(r#"[[name,age,grade]; [bill,20,a] [a b c]] | length"#, "2")
}