summaryrefslogtreecommitdiffstats
path: root/tests/ts/libsmartcols/fromfile
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-06 02:42:50 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-06 02:42:50 +0000
commit8cb83eee5a58b1fad74c34094ce3afb9e430b5a4 (patch)
treea9b2e7baeca1be40eb734371e3c8b11b02294497 /tests/ts/libsmartcols/fromfile
parentInitial commit. (diff)
downloadutil-linux-8cb83eee5a58b1fad74c34094ce3afb9e430b5a4.tar.xz
util-linux-8cb83eee5a58b1fad74c34094ce3afb9e430b5a4.zip
Adding upstream version 2.33.1.upstream/2.33.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/ts/libsmartcols/fromfile')
-rwxr-xr-xtests/ts/libsmartcols/fromfile240
1 files changed, 240 insertions, 0 deletions
diff --git a/tests/ts/libsmartcols/fromfile b/tests/ts/libsmartcols/fromfile
new file mode 100755
index 0000000..274081e
--- /dev/null
+++ b/tests/ts/libsmartcols/fromfile
@@ -0,0 +1,240 @@
+#!/bin/bash
+#
+# 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="fromfile"
+
+. $TS_TOPDIR/functions.sh
+ts_init "$*"
+
+TESTPROG="$TS_HELPER_LIBSMARTCOLS_FROMFILE"
+ts_check_test_command "$TESTPROG"
+
+ts_init_subtest "tree"
+ts_run $TESTPROG --nlines 10 \
+ --tree-id-column 1 \
+ --tree-parent-column 2 \
+ --column $TS_SELF/files/col-tree \
+ --column $TS_SELF/files/col-id \
+ --column $TS_SELF/files/col-parent \
+ --column $TS_SELF/files/col-string \
+ $TS_SELF/files/data-string \
+ $TS_SELF/files/data-id \
+ $TS_SELF/files/data-parent \
+ $TS_SELF/files/data-string-long \
+ >> $TS_OUTPUT 2>&1
+ts_finalize_subtest
+
+ts_init_subtest "tree-json"
+ts_run $TESTPROG --nlines 10 --json \
+ --tree-id-column 1 \
+ --tree-parent-column 2 \
+ --column $TS_SELF/files/col-tree \
+ --column $TS_SELF/files/col-id \
+ --column $TS_SELF/files/col-parent \
+ --column $TS_SELF/files/col-string \
+ $TS_SELF/files/data-string \
+ $TS_SELF/files/data-id \
+ $TS_SELF/files/data-parent \
+ $TS_SELF/files/data-string-long \
+ >> $TS_OUTPUT 2>&1
+ts_finalize_subtest
+
+ts_init_subtest "tree-middle"
+ts_run $TESTPROG --nlines 10 \
+ --tree-id-column 0 \
+ --tree-parent-column 1 \
+ --column $TS_SELF/files/col-id \
+ --column $TS_SELF/files/col-parent \
+ --column $TS_SELF/files/col-tree \
+ --column $TS_SELF/files/col-string \
+ $TS_SELF/files/data-id \
+ $TS_SELF/files/data-parent \
+ $TS_SELF/files/data-string \
+ $TS_SELF/files/data-string-long \
+ >> $TS_OUTPUT 2>&1
+ts_finalize_subtest
+
+ts_init_subtest "tree-end"
+ts_run $TESTPROG --nlines 10 \
+ --tree-id-column 0 \
+ --tree-parent-column 1 \
+ --column $TS_SELF/files/col-id \
+ --column $TS_SELF/files/col-parent \
+ --column $TS_SELF/files/col-string \
+ --column $TS_SELF/files/col-tree \
+ $TS_SELF/files/data-id \
+ $TS_SELF/files/data-parent \
+ $TS_SELF/files/data-string-long \
+ $TS_SELF/files/data-string \
+ >> $TS_OUTPUT 2>&1
+ts_finalize_subtest
+
+ts_init_subtest "trunc"
+ts_run $TESTPROG --nlines 10 --width 40 \
+ --column $TS_SELF/files/col-name \
+ --column $TS_SELF/files/col-number \
+ --column $TS_SELF/files/col-trunc \
+ $TS_SELF/files/data-string \
+ $TS_SELF/files/data-number \
+ $TS_SELF/files/data-string-long \
+ >> $TS_OUTPUT 2>&1
+ts_finalize_subtest
+
+ts_init_subtest "right"
+ts_run $TESTPROG --nlines 10 \
+ --column $TS_SELF/files/col-name \
+ --column $TS_SELF/files/col-number \
+ --column $TS_SELF/files/col-string \
+ $TS_SELF/files/data-string \
+ $TS_SELF/files/data-number \
+ $TS_SELF/files/data-string-long \
+ >> $TS_OUTPUT 2>&1
+ts_finalize_subtest
+
+ts_init_subtest "right-maxout"
+ts_run $TESTPROG --nlines 10 --maxout --width 80\
+ --column $TS_SELF/files/col-name \
+ --column $TS_SELF/files/col-number \
+ $TS_SELF/files/data-string \
+ $TS_SELF/files/data-number \
+ >> $TS_OUTPUT 2>&1
+ts_finalize_subtest
+
+ts_init_subtest "strictwidth"
+ts_run $TESTPROG --nlines 10 \
+ --column $TS_SELF/files/col-name \
+ --column $TS_SELF/files/col-strict \
+ --column $TS_SELF/files/col-number \
+ $TS_SELF/files/data-string \
+ $TS_SELF/files/data-number-tiny \
+ $TS_SELF/files/data-number \
+ >> $TS_OUTPUT 2>&1
+ts_finalize_subtest
+
+ts_init_subtest "noextremes"
+ts_run $TESTPROG --nlines 10 --width 45 \
+ --column $TS_SELF/files/col-name \
+ --column $TS_SELF/files/col-noextremes \
+ --column $TS_SELF/files/col-number \
+ --column $TS_SELF/files/col-name \
+ --column $TS_SELF/files/col-number \
+ $TS_SELF/files/data-string \
+ $TS_SELF/files/data-string-extreme \
+ $TS_SELF/files/data-number \
+ $TS_SELF/files/data-string \
+ $TS_SELF/files/data-number \
+ >> $TS_OUTPUT 2>&1
+ts_finalize_subtest
+
+ts_init_subtest "hidden"
+ts_run $TESTPROG --nlines 10 \
+ --column $TS_SELF/files/col-name \
+ --column $TS_SELF/files/col-hidden \
+ --column $TS_SELF/files/col-number \
+ $TS_SELF/files/data-string \
+ $TS_SELF/files/data-string-long \
+ $TS_SELF/files/data-number \
+ >> $TS_OUTPUT 2>&1
+ts_finalize_subtest
+
+ts_init_subtest "wrap"
+ts_run $TESTPROG --nlines 10 --width 40 \
+ --column $TS_SELF/files/col-name \
+ --column $TS_SELF/files/col-number \
+ --column $TS_SELF/files/col-wrap \
+ $TS_SELF/files/data-string \
+ $TS_SELF/files/data-number \
+ $TS_SELF/files/data-string-long \
+ >> $TS_OUTPUT 2>&1
+ts_finalize_subtest
+
+ts_init_subtest "wrap-tree"
+ts_run $TESTPROG --nlines 10 --width 45 \
+ --tree-id-column 1 \
+ --tree-parent-column 2 \
+ --column $TS_SELF/files/col-tree \
+ --column $TS_SELF/files/col-id \
+ --column $TS_SELF/files/col-parent \
+ --column $TS_SELF/files/col-wrap \
+ $TS_SELF/files/data-string \
+ $TS_SELF/files/data-id \
+ $TS_SELF/files/data-parent \
+ $TS_SELF/files/data-string-long \
+ >> $TS_OUTPUT 2>&1
+ts_finalize_subtest
+
+ts_init_subtest "wrapnl"
+ts_run $TESTPROG --nlines 10 \
+ --column $TS_SELF/files/col-name \
+ --column $TS_SELF/files/col-number \
+ --column $TS_SELF/files/col-wrapnl \
+ $TS_SELF/files/data-string \
+ $TS_SELF/files/data-number \
+ $TS_SELF/files/data-string-nl \
+ >> $TS_OUTPUT 2>&1
+ts_finalize_subtest
+
+ts_init_subtest "wrapnl-tree"
+ts_run $TESTPROG --nlines 10 \
+ --tree-id-column 1 \
+ --tree-parent-column 2 \
+ --column $TS_SELF/files/col-tree \
+ --column $TS_SELF/files/col-id \
+ --column $TS_SELF/files/col-parent \
+ --column $TS_SELF/files/col-wrapnl \
+ $TS_SELF/files/data-string \
+ $TS_SELF/files/data-id \
+ $TS_SELF/files/data-parent \
+ $TS_SELF/files/data-string-nl \
+ >> $TS_OUTPUT 2>&1
+ts_finalize_subtest
+
+ts_init_subtest "raw"
+ts_run $TESTPROG --nlines 10 --raw \
+ --column $TS_SELF/files/col-name \
+ --column $TS_SELF/files/col-number \
+ --column $TS_SELF/files/col-trunc \
+ $TS_SELF/files/data-string \
+ $TS_SELF/files/data-number \
+ $TS_SELF/files/data-string-long \
+ >> $TS_OUTPUT 2>&1
+ts_finalize_subtest
+
+ts_init_subtest "export"
+ts_run $TESTPROG --nlines 10 --export \
+ --column $TS_SELF/files/col-name \
+ --column $TS_SELF/files/col-number \
+ --column $TS_SELF/files/col-trunc \
+ $TS_SELF/files/data-string \
+ $TS_SELF/files/data-number \
+ $TS_SELF/files/data-string-long \
+ >> $TS_OUTPUT 2>&1
+ts_finalize_subtest
+
+ts_init_subtest "column-separator"
+ts_run $TESTPROG --nlines 10 --colsep \| \
+ --column $TS_SELF/files/col-name \
+ --column $TS_SELF/files/col-number \
+ --column $TS_SELF/files/col-trunc \
+ $TS_SELF/files/data-string \
+ $TS_SELF/files/data-number \
+ $TS_SELF/files/data-string-long \
+ >> $TS_OUTPUT 2>&1
+ts_finalize_subtest
+
+ts_log "...done."
+ts_finalize