]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
tests: add another libsmartcols tests
authorKarel Zak <kzak@redhat.com>
Wed, 14 Sep 2016 10:38:34 +0000 (12:38 +0200)
committerKarel Zak <kzak@redhat.com>
Wed, 14 Sep 2016 10:38:34 +0000 (12:38 +0200)
Signed-off-by: Karel Zak <kzak@redhat.com>
tests/ts/libsmartcols/files/col-hidden [new file with mode: 0644]
tests/ts/libsmartcols/files/col-noextremes [new file with mode: 0644]
tests/ts/libsmartcols/files/col-number
tests/ts/libsmartcols/files/col-strict [new file with mode: 0644]
tests/ts/libsmartcols/files/col-trunc [new file with mode: 0644]
tests/ts/libsmartcols/files/data-number-tiny [new file with mode: 0644]
tests/ts/libsmartcols/files/data-string-extreme [new file with mode: 0644]
tests/ts/libsmartcols/fromfile

diff --git a/tests/ts/libsmartcols/files/col-hidden b/tests/ts/libsmartcols/files/col-hidden
new file mode 100644 (file)
index 0000000..83182a8
--- /dev/null
@@ -0,0 +1,3 @@
+FOO
+0
+hidden
diff --git a/tests/ts/libsmartcols/files/col-noextremes b/tests/ts/libsmartcols/files/col-noextremes
new file mode 100644 (file)
index 0000000..715edce
--- /dev/null
@@ -0,0 +1,3 @@
+NOEXTREME
+0
+noextremes
index 5ef733f97d72dde02304c3345463fccc51e53772..34a70e4a4d69a334000576184b368910379bf640 100644 (file)
@@ -1,3 +1,3 @@
 NUM
-3
+0
 right
diff --git a/tests/ts/libsmartcols/files/col-strict b/tests/ts/libsmartcols/files/col-strict
new file mode 100644 (file)
index 0000000..62bb96b
--- /dev/null
@@ -0,0 +1,3 @@
+STRICT
+20
+strictwidth,right
diff --git a/tests/ts/libsmartcols/files/col-trunc b/tests/ts/libsmartcols/files/col-trunc
new file mode 100644 (file)
index 0000000..2887b43
--- /dev/null
@@ -0,0 +1,3 @@
+TRUNC
+0
+trunc
diff --git a/tests/ts/libsmartcols/files/data-number-tiny b/tests/ts/libsmartcols/files/data-number-tiny
new file mode 100644 (file)
index 0000000..8b1acc1
--- /dev/null
@@ -0,0 +1,10 @@
+0
+1
+2
+3
+4
+5
+6
+7
+8
+9
diff --git a/tests/ts/libsmartcols/files/data-string-extreme b/tests/ts/libsmartcols/files/data-string-extreme
new file mode 100644 (file)
index 0000000..6fb395d
--- /dev/null
@@ -0,0 +1,10 @@
+qqqqqqX
+ddddddddX
+ffffffffffffffffffffffffffffffffffX
+sssX
+ddX
+jjjjjX
+mmmmmmmX
+llllllllllX
+yyyyyyX
+pppppX
index b8297ae7deaa95006a8bf845ea7673e38ae1b0c4..074ebf86b23d1335360ece3f56a39a961bafb488 100755 (executable)
@@ -23,6 +23,16 @@ ts_init "$*"
 TESTPROG="$TS_HELPER_LIBSMARTCOLS_FROMFILE"
 ts_check_test_command "$TESTPROG"
 
+ts_init_subtest "trunc"
+$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"
 $TESTPROG --nlines 10 \
@@ -44,6 +54,54 @@ $TESTPROG --nlines 10 --maxout --width 80\
        >> $TS_OUTPUT 2>&1
 ts_finalize_subtest
 
+ts_init_subtest "strictwidth"
+$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"
+$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"
+$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"
+$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 "wrapnl"
 $TESTPROG --nlines 10 \
                --column $TS_SELF/files/col-name \
@@ -55,5 +113,6 @@ $TESTPROG --nlines 10 \
        >> $TS_OUTPUT 2>&1
 ts_finalize_subtest
 
+
 ts_log "...done."
 ts_finalize