From: Karel Zak Date: Thu, 2 Mar 2017 13:21:16 +0000 (+0100) Subject: tests: add column(1) columnate test X-Git-Tag: v2.30-rc1~69 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cee91191ea06822bf676aeb214f6f5b767bedc6b;p=thirdparty%2Futil-linux.git tests: add column(1) columnate test Signed-off-by: Karel Zak --- diff --git a/tests/expected/column/columnate b/tests/expected/column/columnate new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/expected/column/columnate-fill-cols-250 b/tests/expected/column/columnate-fill-cols-250 new file mode 100644 index 0000000000..96489155c6 --- /dev/null +++ b/tests/expected/column/columnate-fill-cols-250 @@ -0,0 +1 @@ +AAAAAAAAAAAAAAAAAAAA BBBBBBBBBBBBBBBBBBBBB CCCCCCCCCCCCCCCC DDDDDDDDDDDDDDDDD EEEEEEEEEEEEE FFFFFFFFFFFFFFFFFFF XXXXXXX YYYYYYYYYYY ZZZZZZZZZZZ diff --git a/tests/expected/column/columnate-fill-cols-50 b/tests/expected/column/columnate-fill-cols-50 new file mode 100644 index 0000000000..d287c158da --- /dev/null +++ b/tests/expected/column/columnate-fill-cols-50 @@ -0,0 +1,5 @@ +AAAAAAAAAAAAAAAAAAAA FFFFFFFFFFFFFFFFFFF +BBBBBBBBBBBBBBBBBBBBB XXXXXXX +CCCCCCCCCCCCCCCC YYYYYYYYYYY +DDDDDDDDDDDDDDDDD ZZZZZZZZZZZ +EEEEEEEEEEEEE diff --git a/tests/expected/column/columnate-fill-cols-80 b/tests/expected/column/columnate-fill-cols-80 new file mode 100644 index 0000000000..a004406cf7 --- /dev/null +++ b/tests/expected/column/columnate-fill-cols-80 @@ -0,0 +1,3 @@ +AAAAAAAAAAAAAAAAAAAA DDDDDDDDDDDDDDDDD XXXXXXX +BBBBBBBBBBBBBBBBBBBBB EEEEEEEEEEEEE YYYYYYYYYYY +CCCCCCCCCCCCCCCC FFFFFFFFFFFFFFFFFFF ZZZZZZZZZZZ diff --git a/tests/expected/column/columnate-fill-rows-250 b/tests/expected/column/columnate-fill-rows-250 new file mode 100644 index 0000000000..96489155c6 --- /dev/null +++ b/tests/expected/column/columnate-fill-rows-250 @@ -0,0 +1 @@ +AAAAAAAAAAAAAAAAAAAA BBBBBBBBBBBBBBBBBBBBB CCCCCCCCCCCCCCCC DDDDDDDDDDDDDDDDD EEEEEEEEEEEEE FFFFFFFFFFFFFFFFFFF XXXXXXX YYYYYYYYYYY ZZZZZZZZZZZ diff --git a/tests/expected/column/columnate-fill-rows-50 b/tests/expected/column/columnate-fill-rows-50 new file mode 100644 index 0000000000..9f35a130b8 --- /dev/null +++ b/tests/expected/column/columnate-fill-rows-50 @@ -0,0 +1,5 @@ +AAAAAAAAAAAAAAAAAAAA BBBBBBBBBBBBBBBBBBBBB +CCCCCCCCCCCCCCCC DDDDDDDDDDDDDDDDD +EEEEEEEEEEEEE FFFFFFFFFFFFFFFFFFF +XXXXXXX YYYYYYYYYYY +ZZZZZZZZZZZ diff --git a/tests/expected/column/columnate-fill-rows-80 b/tests/expected/column/columnate-fill-rows-80 new file mode 100644 index 0000000000..92635f750e --- /dev/null +++ b/tests/expected/column/columnate-fill-rows-80 @@ -0,0 +1,3 @@ +AAAAAAAAAAAAAAAAAAAA BBBBBBBBBBBBBBBBBBBBB CCCCCCCCCCCCCCCC +DDDDDDDDDDDDDDDDD EEEEEEEEEEEEE FFFFFFFFFFFFFFFFFFF +XXXXXXX YYYYYYYYYYY ZZZZZZZZZZZ diff --git a/tests/expected/column/fillrow b/tests/expected/column/fillrow deleted file mode 100644 index 07f99520f6..0000000000 --- a/tests/expected/column/fillrow +++ /dev/null @@ -1,4 +0,0 @@ -0 1 2 3 4 5 0 1 2 3 4 5 0 1 2 3 4 5 -0 1 2 3 4 5 0 1 2 3 4 5 0 1 2 3 4 5 -0 1 2 3 4 5 0 1 2 3 4 5 0 1 2 3 4 5 -0 1 2 3 4 5 diff --git a/tests/ts/column/columnate b/tests/ts/column/columnate new file mode 100755 index 0000000000..24e29db114 --- /dev/null +++ b/tests/ts/column/columnate @@ -0,0 +1,53 @@ +#!/bin/bash + +# +# Copyright (C) 2011 Sami Kerola +# +# 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 0000000000..69ec82f5d1 --- /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 a3bdd550b9..0000000000 --- a/tests/ts/column/fillrow +++ /dev/null @@ -1,31 +0,0 @@ -#!/bin/bash - -# -# Copyright (C) 2011 Sami Kerola -# -# 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 -