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