]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
tests: add column(1) columnate test
authorKarel Zak <kzak@redhat.com>
Thu, 2 Mar 2017 13:21:16 +0000 (14:21 +0100)
committerKarel Zak <kzak@redhat.com>
Tue, 2 May 2017 10:17:59 +0000 (12:17 +0200)
Signed-off-by: Karel Zak <kzak@redhat.com>
tests/expected/column/columnate [new file with mode: 0644]
tests/expected/column/columnate-fill-cols-250 [new file with mode: 0644]
tests/expected/column/columnate-fill-cols-50 [new file with mode: 0644]
tests/expected/column/columnate-fill-cols-80 [new file with mode: 0644]
tests/expected/column/columnate-fill-rows-250 [new file with mode: 0644]
tests/expected/column/columnate-fill-rows-50 [new file with mode: 0644]
tests/expected/column/columnate-fill-rows-80 [new file with mode: 0644]
tests/expected/column/fillrow [deleted file]
tests/ts/column/columnate [new file with mode: 0755]
tests/ts/column/files/onecolumn [new file with mode: 0644]
tests/ts/column/fillrow [deleted file]

diff --git a/tests/expected/column/columnate b/tests/expected/column/columnate
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/tests/expected/column/columnate-fill-cols-250 b/tests/expected/column/columnate-fill-cols-250
new file mode 100644 (file)
index 0000000..9648915
--- /dev/null
@@ -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 (file)
index 0000000..d287c15
--- /dev/null
@@ -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 (file)
index 0000000..a004406
--- /dev/null
@@ -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 (file)
index 0000000..9648915
--- /dev/null
@@ -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 (file)
index 0000000..9f35a13
--- /dev/null
@@ -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 (file)
index 0000000..92635f7
--- /dev/null
@@ -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 (file)
index 07f9952..0000000
+++ /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 (executable)
index 0000000..24e29db
--- /dev/null
@@ -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 (file)
index 0000000..69ec82f
--- /dev/null
@@ -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 (executable)
index a3bdd55..0000000
+++ /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
-