mirror of
https://github.com/nushell/nushell.git
synced 2025-08-15 07:53:18 +02:00
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:
@ -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")
|
||||
}
|
||||
|
Reference in New Issue
Block a user