summaryrefslogtreecommitdiffstats
path: root/tests/ts/column
diff options
context:
space:
mode:
authorKarel Zak2017-03-02 14:21:16 +0100
committerKarel Zak2017-05-02 12:17:59 +0200
commitcee91191ea06822bf676aeb214f6f5b767bedc6b (patch)
tree71d2a462adeaf21b4b31d4f9849d66fa72a682d4 /tests/ts/column
parentcolumn: don't ignore mbs_to_wcs() errors (diff)
downloadkernel-qcow2-util-linux-cee91191ea06822bf676aeb214f6f5b767bedc6b.tar.gz
kernel-qcow2-util-linux-cee91191ea06822bf676aeb214f6f5b767bedc6b.tar.xz
kernel-qcow2-util-linux-cee91191ea06822bf676aeb214f6f5b767bedc6b.zip
tests: add column(1) columnate test
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'tests/ts/column')
-rwxr-xr-xtests/ts/column/columnate53
-rw-r--r--tests/ts/column/files/onecolumn9
-rwxr-xr-xtests/ts/column/fillrow31
3 files changed, 62 insertions, 31 deletions
diff --git a/tests/ts/column/columnate b/tests/ts/column/columnate
new file mode 100755
index 000000000..24e29db11
--- /dev/null
+++ b/tests/ts/column/columnate
@@ -0,0 +1,53 @@
+#!/bin/bash
+
+#
+# Copyright (C) 2011 Sami Kerola <kerolasa@iki.fi>
+#
+# This file is part of util-linux.
+#
+# This file is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This file is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+TS_TOPDIR="${0%/*}/../.."
+TS_DESC="columnate"
+
+. $TS_TOPDIR/functions.sh
+ts_init "$*"
+
+ts_check_test_command "$TS_CMD_COLUMN"
+ts_cd "$TS_OUTDIR"
+
+
+ts_init_subtest "fill-cols-80"
+$TS_CMD_COLUMN -c 80 $TS_SELF/files/onecolumn >> $TS_OUTPUT 2>&1
+ts_finalize_subtest
+
+ts_init_subtest "fill-cols-50"
+$TS_CMD_COLUMN -c 50 $TS_SELF/files/onecolumn >> $TS_OUTPUT 2>&1
+ts_finalize_subtest
+
+ts_init_subtest "fill-cols-250"
+$TS_CMD_COLUMN -c 250 $TS_SELF/files/onecolumn >> $TS_OUTPUT 2>&1
+ts_finalize_subtest
+
+ts_init_subtest "fill-rows-80"
+$TS_CMD_COLUMN --fillrows -c 80 $TS_SELF/files/onecolumn >> $TS_OUTPUT 2>&1
+ts_finalize_subtest
+
+ts_init_subtest "fill-rows-50"
+$TS_CMD_COLUMN --fillrows -c 50 $TS_SELF/files/onecolumn >> $TS_OUTPUT 2>&1
+ts_finalize_subtest
+
+ts_init_subtest "fill-rows-250"
+$TS_CMD_COLUMN --fillrows -c 250 $TS_SELF/files/onecolumn >> $TS_OUTPUT 2>&1
+ts_finalize_subtest
+
+ts_finalize
+
diff --git a/tests/ts/column/files/onecolumn b/tests/ts/column/files/onecolumn
new file mode 100644
index 000000000..69ec82f5d
--- /dev/null
+++ b/tests/ts/column/files/onecolumn
@@ -0,0 +1,9 @@
+AAAAAAAAAAAAAAAAAAAA
+BBBBBBBBBBBBBBBBBBBBB
+CCCCCCCCCCCCCCCC
+DDDDDDDDDDDDDDDDD
+EEEEEEEEEEEEE
+FFFFFFFFFFFFFFFFFFF
+XXXXXXX
+YYYYYYYYYYY
+ZZZZZZZZZZZ
diff --git a/tests/ts/column/fillrow b/tests/ts/column/fillrow
deleted file mode 100755
index a3bdd550b..000000000
--- a/tests/ts/column/fillrow
+++ /dev/null
@@ -1,31 +0,0 @@
-#!/bin/bash
-
-#
-# Copyright (C) 2011 Sami Kerola <kerolasa@iki.fi>
-#
-# This file is part of util-linux.
-#
-# This file is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This file is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-TS_TOPDIR="${0%/*}/../.."
-TS_DESC="fill row"
-
-. $TS_TOPDIR/functions.sh
-ts_init "$*"
-
-ts_check_test_command "$TS_CMD_COLUMN"
-
-ts_cd "$TS_OUTDIR"
-
-$TS_CMD_COLUMN -x -c 50 $TS_SELF/files/fivecols >> $TS_OUTPUT 2>&1
-
-ts_finalize
-