tests: add column(1) table test

Signed-off-by: Karel Zak <kzak@redhat.com>
This commit is contained in:
Karel Zak 2017-03-02 14:34:08 +01:00
parent cee91191ea
commit 2acfa40ac1
7 changed files with 42 additions and 4 deletions

View File

View File

@ -0,0 +1,6 @@
AAA BBBB C DDDD
A BBB CCCC DDD
AA BB CCC DD
AAAA B CC D
AA BB CC DD
AAAAA BBB CCC DDDD

View File

@ -0,0 +1,6 @@
AAA BBBB C DDDD
A BBB CCCC DDD
AA BB DD
AAAA B CC D
AA CC DD
AAAAA BBB CCC DDDD

View File

@ -0,0 +1,6 @@
AAA |BBBB|C |DDDD
A |BBB |CCCC|DDD
AA |BB |CCC |DD
AAAA |B |CC |D
AA |BB |CC |DD
AAAAA|BBB |CCC |DDDD

View File

@ -0,0 +1,6 @@
AAA BBBB C DDDD
A BBB CCCC DDD
AA BB CCC DD
AAAA B CC D
AA BB CC DD
AAAAA BBB CCC DDDD

View File

@ -0,0 +1,6 @@
AAA,BBBB,C,DDDD
A,BBB,CCCC,DDD
AA,BB,,DD
AAAA,B,CC,D
AA,,CC,DD
AAAAA,BBB,CCC,DDDD

View File

@ -16,16 +16,24 @@
# GNU General Public License for more details.
#
TS_TOPDIR="${0%/*}/../.."
TS_DESC="separator & table"
TS_DESC="table"
. $TS_TOPDIR/functions.sh
ts_init "$*"
ts_check_test_command "$TS_CMD_COLUMN"
ts_cd "$TS_OUTDIR"
$TS_CMD_COLUMN -s 2 -t $TS_SELF/files/fivecols >> $TS_OUTPUT 2>&1
ts_init_subtest "default"
$TS_CMD_COLUMN --table $TS_SELF/files/table >> $TS_OUTPUT 2>&1
ts_finalize_subtest
ts_init_subtest "output-separator"
$TS_CMD_COLUMN --output-separator '|' --table $TS_SELF/files/table >> $TS_OUTPUT 2>&1
ts_finalize_subtest
ts_init_subtest "input-separator"
$TS_CMD_COLUMN --separator ',' --table $TS_SELF/files/table-sep >> $TS_OUTPUT 2>&1
ts_finalize_subtest
ts_finalize