From 2acfa40ac128a5f271c20515b10adbd0403aba25 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Thu, 2 Mar 2017 14:34:08 +0100 Subject: [PATCH] tests: add column(1) table test Signed-off-by: Karel Zak --- tests/expected/column/table | 0 tests/expected/column/table-default | 6 ++++++ tests/expected/column/table-input-separator | 6 ++++++ tests/expected/column/table-output-separator | 6 ++++++ tests/ts/column/files/table | 6 ++++++ tests/ts/column/files/table-sep | 6 ++++++ tests/ts/column/{separator_table => table} | 16 ++++++++++++---- 7 files changed, 42 insertions(+), 4 deletions(-) create mode 100644 tests/expected/column/table create mode 100644 tests/expected/column/table-default create mode 100644 tests/expected/column/table-input-separator create mode 100644 tests/expected/column/table-output-separator create mode 100644 tests/ts/column/files/table create mode 100644 tests/ts/column/files/table-sep rename tests/ts/column/{separator_table => table} (64%) diff --git a/tests/expected/column/table b/tests/expected/column/table new file mode 100644 index 000000000..e69de29bb diff --git a/tests/expected/column/table-default b/tests/expected/column/table-default new file mode 100644 index 000000000..5fc905dfe --- /dev/null +++ b/tests/expected/column/table-default @@ -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 index 000000000..284f4ef79 --- /dev/null +++ b/tests/expected/column/table-input-separator @@ -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 index 000000000..c9199dbf4 --- /dev/null +++ b/tests/expected/column/table-output-separator @@ -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 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 similarity index 64% rename from tests/ts/column/separator_table rename to 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_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 -