Fix column count to not break on empty tables (#2374)

This commit is contained in:
Joseph T. Lyons
2020-08-18 22:16:35 -04:00
committed by GitHub
parent 43e061f8c6
commit 6126209f57
2 changed files with 29 additions and 14 deletions

View File

@ -11,3 +11,15 @@ fn count_columns_in_cal_table() {
assert_eq!(actual.out, "7");
}
#[test]
fn count_columns_no_rows() {
let actual = nu!(
cwd: ".", pipeline(
r#"
echo [] | count -c
"#
));
assert_eq!(actual.out, "0");
}