summaryrefslogtreecommitdiffstats
path: root/tests/ts/column
diff options
context:
space:
mode:
authorKarel Zak2017-03-02 14:34:08 +0100
committerKarel Zak2017-05-02 12:18:00 +0200
commit2acfa40ac128a5f271c20515b10adbd0403aba25 (patch)
tree5ad2238599b57eec22b833aff0181e925fc8ceb5 /tests/ts/column
parenttests: add column(1) columnate test (diff)
downloadkernel-qcow2-util-linux-2acfa40ac128a5f271c20515b10adbd0403aba25.tar.gz
kernel-qcow2-util-linux-2acfa40ac128a5f271c20515b10adbd0403aba25.tar.xz
kernel-qcow2-util-linux-2acfa40ac128a5f271c20515b10adbd0403aba25.zip
tests: add column(1) table test
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'tests/ts/column')
-rw-r--r--tests/ts/column/files/table6
-rw-r--r--tests/ts/column/files/table-sep6
-rwxr-xr-xtests/ts/column/table (renamed from tests/ts/column/separator_table)16
3 files changed, 24 insertions, 4 deletions
diff --git a/tests/ts/column/files/table b/tests/ts/column/files/table
new file mode 100644
index 000000000..e051631f7
--- /dev/null
+++ b/tests/ts/column/files/table
@@ -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
diff --git a/tests/ts/column/files/table-sep b/tests/ts/column/files/table-sep
new file mode 100644
index 000000000..c56bac891
--- /dev/null
+++ b/tests/ts/column/files/table-sep
@@ -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
diff --git a/tests/ts/column/separator_table b/tests/ts/column/table
index 4ac910d8e..c977b96e2 100755
--- a/tests/ts/column/separator_table
+++ b/tests/ts/column/table
@@ -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_finalize
+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