2020-08-16 03:16:49 +00:00
|
|
|
use nu_test_support::{nu, pipeline};
|
|
|
|
|
|
|
|
#[test]
|
2021-03-13 21:46:40 +00:00
|
|
|
fn length_columns_in_cal_table() {
|
2020-08-16 03:16:49 +00:00
|
|
|
let actual = nu!(
|
|
|
|
cwd: ".", pipeline(
|
|
|
|
r#"
|
2021-03-13 21:46:40 +00:00
|
|
|
cal | length -c
|
2020-08-16 03:16:49 +00:00
|
|
|
"#
|
|
|
|
));
|
|
|
|
|
|
|
|
assert_eq!(actual.out, "7");
|
|
|
|
}
|
2020-08-19 02:16:35 +00:00
|
|
|
|
|
|
|
#[test]
|
2021-03-13 21:46:40 +00:00
|
|
|
fn length_columns_no_rows() {
|
2020-08-19 02:16:35 +00:00
|
|
|
let actual = nu!(
|
|
|
|
cwd: ".", pipeline(
|
|
|
|
r#"
|
2021-03-13 21:46:40 +00:00
|
|
|
echo [] | length -c
|
2020-08-19 02:16:35 +00:00
|
|
|
"#
|
|
|
|
));
|
|
|
|
|
|
|
|
assert_eq!(actual.out, "0");
|
|
|
|
}
|