]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
tests: add column(1) table test
authorKarel Zak <kzak@redhat.com>
Thu, 2 Mar 2017 13:34:08 +0000 (14:34 +0100)
committerKarel Zak <kzak@redhat.com>
Tue, 2 May 2017 10:18:00 +0000 (12:18 +0200)
Signed-off-by: Karel Zak <kzak@redhat.com>
tests/expected/column/table [new file with mode: 0644]
tests/expected/column/table-default [new file with mode: 0644]
tests/expected/column/table-input-separator [new file with mode: 0644]
tests/expected/column/table-output-separator [new file with mode: 0644]
tests/ts/column/files/table [new file with mode: 0644]
tests/ts/column/files/table-sep [new file with mode: 0644]
tests/ts/column/table [moved from tests/ts/column/separator_table with 64% similarity]

diff --git a/tests/expected/column/table b/tests/expected/column/table
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/tests/expected/column/table-default b/tests/expected/column/table-default
new file mode 100644 (file)
index 0000000..5fc905d
--- /dev/null
@@ -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/expected/column/table-input-separator b/tests/expected/column/table-input-separator
new file mode 100644 (file)
index 0000000..284f4ef
--- /dev/null
@@ -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/expected/column/table-output-separator b/tests/expected/column/table-output-separator
new file mode 100644 (file)
index 0000000..c9199db
--- /dev/null
@@ -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 b/tests/ts/column/files/table
new file mode 100644 (file)
index 0000000..e051631
--- /dev/null
@@ -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 (file)
index 0000000..c56bac8
--- /dev/null
@@ -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 
similarity index 64%
rename from tests/ts/column/separator_table
rename to tests/ts/column/table
index 4ac910d8e8e2af3505cd8b1e4b90677476307160..c977b96e20f7537466169a93883b504c8530ebb4 100755 (executable)
 # 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