From 325bfd53e889fd52f240e4bcbd690b03dddc7570 Mon Sep 17 00:00:00 2001 From: Yousong Zhou Date: Mon, 29 Jul 2019 01:24:29 +0000 Subject: column: fix outputing empty column at the end of line The following commands manifests the problem. In old versions before commit 4762ae9d60 ("column: use libsmartcols for --table"), both of them should output with 2 "|" echo '||' | column -o '|' -s '|' -t echo '|| ' | column -o '|' -s '|' -t Fixes: 4762ae9d60 ("column: use libsmartcols for --table") Signed-off-by: Yousong Zhou Reviewed-by: Sami Kerola --- tests/ts/column/table | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'tests/ts/column/table') diff --git a/tests/ts/column/table b/tests/ts/column/table index bd1f16f3f..e64dee746 100755 --- a/tests/ts/column/table +++ b/tests/ts/column/table @@ -116,4 +116,12 @@ ts_init_subtest "empty-column" printf ':a:b\n' | $TS_CMD_COLUMN --table --separator ':' --output-separator ':' >> $TS_OUTPUT 2>&1 ts_finalize_subtest +ts_init_subtest "empty-column-at-eol" +printf '|' | $TS_CMD_COLUMN --separator '|' --output-separator '|' --table >> $TS_OUTPUT 2>&1 +ts_finalize_subtest + +ts_init_subtest "empty-column-at-eol2" +printf '||' | $TS_CMD_COLUMN --separator '|' --output-separator '|' --table >> $TS_OUTPUT 2>&1 +ts_finalize_subtest + ts_finalize -- cgit v1.2.3-55-g7522