dcavalca / rpms / util-linux

Forked from rpms/util-linux 2 years ago
Clone

Blame SOURCES/0154-tests-backport-libsmartcols-tests.patch

ad9577
From 83f79678dbb9cb48969968fa4df57d98c67a321d Mon Sep 17 00:00:00 2001
ad9577
From: Karel Zak <kzak@redhat.com>
ad9577
Date: Thu, 31 May 2018 11:44:35 +0200
ad9577
Subject: [PATCH 154/173] tests: backport libsmartcols tests
ad9577
ad9577
Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1561350
ad9577
Signed-off-by: Karel Zak <kzak@redhat.com>
ad9577
---
ad9577
 tests/commands.sh                                  |   2 +
ad9577
 tests/expected/libsmartcols/fromfile               |   1 +
ad9577
 .../libsmartcols/fromfile-column-separator         |  11 +
ad9577
 tests/expected/libsmartcols/fromfile-export        |  10 +
ad9577
 tests/expected/libsmartcols/fromfile-hidden        |  11 +
ad9577
 tests/expected/libsmartcols/fromfile-noextremes    |  12 ++
ad9577
 tests/expected/libsmartcols/fromfile-raw           |  11 +
ad9577
 tests/expected/libsmartcols/fromfile-right         |  11 +
ad9577
 tests/expected/libsmartcols/fromfile-right-maxout  |  11 +
ad9577
 tests/expected/libsmartcols/fromfile-strictwidth   |  11 +
ad9577
 tests/expected/libsmartcols/fromfile-tree          |  11 +
ad9577
 tests/expected/libsmartcols/fromfile-tree-end      |  11 +
ad9577
 tests/expected/libsmartcols/fromfile-tree-json     |  29 +++
ad9577
 tests/expected/libsmartcols/fromfile-tree-middle   |  11 +
ad9577
 tests/expected/libsmartcols/fromfile-trunc         |  11 +
ad9577
 tests/expected/libsmartcols/fromfile-wrap          |  17 ++
ad9577
 tests/expected/libsmartcols/fromfile-wrap-tree     |  18 ++
ad9577
 tests/expected/libsmartcols/fromfile-wrapnl        |  19 ++
ad9577
 tests/expected/libsmartcols/fromfile-wrapnl-tree   |  19 ++
ad9577
 tests/expected/libsmartcols/title                  |  16 ++
ad9577
 tests/ts/libsmartcols/files/col-hidden             |   3 +
ad9577
 tests/ts/libsmartcols/files/col-id                 |   3 +
ad9577
 tests/ts/libsmartcols/files/col-name               |   3 +
ad9577
 tests/ts/libsmartcols/files/col-noextremes         |   3 +
ad9577
 tests/ts/libsmartcols/files/col-number             |   3 +
ad9577
 tests/ts/libsmartcols/files/col-parent             |   3 +
ad9577
 tests/ts/libsmartcols/files/col-strict             |   3 +
ad9577
 tests/ts/libsmartcols/files/col-string             |   3 +
ad9577
 tests/ts/libsmartcols/files/col-tree               |   3 +
ad9577
 tests/ts/libsmartcols/files/col-trunc              |   3 +
ad9577
 tests/ts/libsmartcols/files/col-wrap               |   3 +
ad9577
 tests/ts/libsmartcols/files/col-wrapnl             |   3 +
ad9577
 tests/ts/libsmartcols/files/data-id                |  10 +
ad9577
 tests/ts/libsmartcols/files/data-number            |  10 +
ad9577
 tests/ts/libsmartcols/files/data-number-tiny       |  10 +
ad9577
 tests/ts/libsmartcols/files/data-parent            |  10 +
ad9577
 tests/ts/libsmartcols/files/data-string            |  10 +
ad9577
 tests/ts/libsmartcols/files/data-string-extreme    |  10 +
ad9577
 tests/ts/libsmartcols/files/data-string-long       |  10 +
ad9577
 tests/ts/libsmartcols/files/data-string-nl         |  10 +
ad9577
 tests/ts/libsmartcols/fromfile                     | 240 +++++++++++++++++++++
ad9577
 tests/ts/libsmartcols/title                        |  28 +++
ad9577
 42 files changed, 637 insertions(+)
ad9577
 create mode 100644 tests/expected/libsmartcols/fromfile
ad9577
 create mode 100644 tests/expected/libsmartcols/fromfile-column-separator
ad9577
 create mode 100644 tests/expected/libsmartcols/fromfile-export
ad9577
 create mode 100644 tests/expected/libsmartcols/fromfile-hidden
ad9577
 create mode 100644 tests/expected/libsmartcols/fromfile-noextremes
ad9577
 create mode 100644 tests/expected/libsmartcols/fromfile-raw
ad9577
 create mode 100644 tests/expected/libsmartcols/fromfile-right
ad9577
 create mode 100644 tests/expected/libsmartcols/fromfile-right-maxout
ad9577
 create mode 100644 tests/expected/libsmartcols/fromfile-strictwidth
ad9577
 create mode 100644 tests/expected/libsmartcols/fromfile-tree
ad9577
 create mode 100644 tests/expected/libsmartcols/fromfile-tree-end
ad9577
 create mode 100644 tests/expected/libsmartcols/fromfile-tree-json
ad9577
 create mode 100644 tests/expected/libsmartcols/fromfile-tree-middle
ad9577
 create mode 100644 tests/expected/libsmartcols/fromfile-trunc
ad9577
 create mode 100644 tests/expected/libsmartcols/fromfile-wrap
ad9577
 create mode 100644 tests/expected/libsmartcols/fromfile-wrap-tree
ad9577
 create mode 100644 tests/expected/libsmartcols/fromfile-wrapnl
ad9577
 create mode 100644 tests/expected/libsmartcols/fromfile-wrapnl-tree
ad9577
 create mode 100644 tests/expected/libsmartcols/title
ad9577
 create mode 100644 tests/ts/libsmartcols/files/col-hidden
ad9577
 create mode 100644 tests/ts/libsmartcols/files/col-id
ad9577
 create mode 100644 tests/ts/libsmartcols/files/col-name
ad9577
 create mode 100644 tests/ts/libsmartcols/files/col-noextremes
ad9577
 create mode 100644 tests/ts/libsmartcols/files/col-number
ad9577
 create mode 100644 tests/ts/libsmartcols/files/col-parent
ad9577
 create mode 100644 tests/ts/libsmartcols/files/col-strict
ad9577
 create mode 100644 tests/ts/libsmartcols/files/col-string
ad9577
 create mode 100644 tests/ts/libsmartcols/files/col-tree
ad9577
 create mode 100644 tests/ts/libsmartcols/files/col-trunc
ad9577
 create mode 100644 tests/ts/libsmartcols/files/col-wrap
ad9577
 create mode 100644 tests/ts/libsmartcols/files/col-wrapnl
ad9577
 create mode 100644 tests/ts/libsmartcols/files/data-id
ad9577
 create mode 100644 tests/ts/libsmartcols/files/data-number
ad9577
 create mode 100644 tests/ts/libsmartcols/files/data-number-tiny
ad9577
 create mode 100644 tests/ts/libsmartcols/files/data-parent
ad9577
 create mode 100644 tests/ts/libsmartcols/files/data-string
ad9577
 create mode 100644 tests/ts/libsmartcols/files/data-string-extreme
ad9577
 create mode 100644 tests/ts/libsmartcols/files/data-string-long
ad9577
 create mode 100644 tests/ts/libsmartcols/files/data-string-nl
ad9577
 create mode 100755 tests/ts/libsmartcols/fromfile
ad9577
 create mode 100755 tests/ts/libsmartcols/title
ad9577
ad9577
diff --git a/tests/commands.sh b/tests/commands.sh
ad9577
index e769b5dac..96b8dc97c 100644
ad9577
--- a/tests/commands.sh
ad9577
+++ b/tests/commands.sh
ad9577
@@ -20,6 +20,8 @@ TS_HELPER_PARTITIONS="$top_builddir/sample-partitions"
ad9577
 TS_HELPER_PATHS="$top_builddir/test_pathnames"
ad9577
 TS_HELPER_STRUTILS="$top_builddir/test_strutils"
ad9577
 TS_HELPER_SYSINFO="$top_builddir/test_sysinfo"
ad9577
+TS_HELPER_LIBSMARTCOLS_FROMFILE="$top_builddir/sample-scols-fromfile"
ad9577
+TS_HELPER_LIBSMARTCOLS_TITLE="$top_builddir/sample-scols-title"
ad9577
 
ad9577
 # paths to commands
ad9577
 TS_CMD_BLKID=${TS_CMD_BLKID-"$top_builddir/blkid"}
ad9577
diff --git a/tests/expected/libsmartcols/fromfile b/tests/expected/libsmartcols/fromfile
ad9577
new file mode 100644
ad9577
index 000000000..4155aa36f
ad9577
--- /dev/null
ad9577
+++ b/tests/expected/libsmartcols/fromfile
ad9577
@@ -0,0 +1 @@
ad9577
+...done.
ad9577
diff --git a/tests/expected/libsmartcols/fromfile-column-separator b/tests/expected/libsmartcols/fromfile-column-separator
ad9577
new file mode 100644
ad9577
index 000000000..8c5aa2aff
ad9577
--- /dev/null
ad9577
+++ b/tests/expected/libsmartcols/fromfile-column-separator
ad9577
@@ -0,0 +1,11 @@
ad9577
+NAME  |      NUM|TRUNC
ad9577
+aaaa  |        0|qqqqqqqqqqqqqqqqqX
ad9577
+bbb   |      100|dddddddddddddX
ad9577
+ccccc |       21|ffffffffffffffffffffffffffffffffffffffffX
ad9577
+dddddd|        3|ssssssssssX
ad9577
+ee    |      411|ddddddddddddddddddddddddddX
ad9577
+ffff  |     5111|jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjX
ad9577
+gggggg|678993321|mmmmmmmmmmmmmmmmmmmX
ad9577
+hhh   |  7666666|lllllllllllllllllllllllllllllllllllllX
ad9577
+iiiiii|     8765|yyyyyyyyyyyyyyyyyyyyyyyyyyyyX
ad9577
+jj    |   987456|pppppppppX
ad9577
diff --git a/tests/expected/libsmartcols/fromfile-export b/tests/expected/libsmartcols/fromfile-export
ad9577
new file mode 100644
ad9577
index 000000000..f63afd882
ad9577
--- /dev/null
ad9577
+++ b/tests/expected/libsmartcols/fromfile-export
ad9577
@@ -0,0 +1,10 @@
ad9577
+NAME="aaaa" NUM="0" TRUNC="qqqqqqqqqqqqqqqqqX"
ad9577
+NAME="bbb" NUM="100" TRUNC="dddddddddddddX"
ad9577
+NAME="ccccc" NUM="21" TRUNC="ffffffffffffffffffffffffffffffffffffffffX"
ad9577
+NAME="dddddd" NUM="3" TRUNC="ssssssssssX"
ad9577
+NAME="ee" NUM="411" TRUNC="ddddddddddddddddddddddddddX"
ad9577
+NAME="ffff" NUM="5111" TRUNC="jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjX"
ad9577
+NAME="gggggg" NUM="678993321" TRUNC="mmmmmmmmmmmmmmmmmmmX"
ad9577
+NAME="hhh" NUM="7666666" TRUNC="lllllllllllllllllllllllllllllllllllllX"
ad9577
+NAME="iiiiii" NUM="8765" TRUNC="yyyyyyyyyyyyyyyyyyyyyyyyyyyyX"
ad9577
+NAME="jj" NUM="987456" TRUNC="pppppppppX"
ad9577
diff --git a/tests/expected/libsmartcols/fromfile-hidden b/tests/expected/libsmartcols/fromfile-hidden
ad9577
new file mode 100644
ad9577
index 000000000..cf50bcb3e
ad9577
--- /dev/null
ad9577
+++ b/tests/expected/libsmartcols/fromfile-hidden
ad9577
@@ -0,0 +1,11 @@
ad9577
+NAME         NUM
ad9577
+aaaa           0
ad9577
+bbb          100
ad9577
+ccccc         21
ad9577
+dddddd         3
ad9577
+ee           411
ad9577
+ffff        5111
ad9577
+gggggg 678993321
ad9577
+hhh      7666666
ad9577
+iiiiii      8765
ad9577
+jj        987456
ad9577
diff --git a/tests/expected/libsmartcols/fromfile-noextremes b/tests/expected/libsmartcols/fromfile-noextremes
ad9577
new file mode 100644
ad9577
index 000000000..4bac08070
ad9577
--- /dev/null
ad9577
+++ b/tests/expected/libsmartcols/fromfile-noextremes
ad9577
@@ -0,0 +1,12 @@
ad9577
+NAME   NOEXTREME         NUM NAME         NUM
ad9577
+aaaa   qqqqqqX             0 aaaa           0
ad9577
+bbb    ddddddddX         100 bbb          100
ad9577
+ccccc  ffffffffffffffffffffffffffffffffffX
ad9577
+                          21 ccccc         21
ad9577
+dddddd sssX                3 dddddd         3
ad9577
+ee     ddX               411 ee           411
ad9577
+ffff   jjjjjX           5111 ffff        5111
ad9577
+gggggg mmmmmmmX    678993321 gggggg 678993321
ad9577
+hhh    llllllllllX   7666666 hhh      7666666
ad9577
+iiiiii yyyyyyX          8765 iiiiii      8765
ad9577
+jj     pppppX         987456 jj        987456
ad9577
diff --git a/tests/expected/libsmartcols/fromfile-raw b/tests/expected/libsmartcols/fromfile-raw
ad9577
new file mode 100644
ad9577
index 000000000..cc188aaab
ad9577
--- /dev/null
ad9577
+++ b/tests/expected/libsmartcols/fromfile-raw
ad9577
@@ -0,0 +1,11 @@
ad9577
+NAME NUM TRUNC
ad9577
+aaaa 0 qqqqqqqqqqqqqqqqqX
ad9577
+bbb 100 dddddddddddddX
ad9577
+ccccc 21 ffffffffffffffffffffffffffffffffffffffffX
ad9577
+dddddd 3 ssssssssssX
ad9577
+ee 411 ddddddddddddddddddddddddddX
ad9577
+ffff 5111 jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjX
ad9577
+gggggg 678993321 mmmmmmmmmmmmmmmmmmmX
ad9577
+hhh 7666666 lllllllllllllllllllllllllllllllllllllX
ad9577
+iiiiii 8765 yyyyyyyyyyyyyyyyyyyyyyyyyyyyX
ad9577
+jj 987456 pppppppppX
ad9577
diff --git a/tests/expected/libsmartcols/fromfile-right b/tests/expected/libsmartcols/fromfile-right
ad9577
new file mode 100644
ad9577
index 000000000..d78285a13
ad9577
--- /dev/null
ad9577
+++ b/tests/expected/libsmartcols/fromfile-right
ad9577
@@ -0,0 +1,11 @@
ad9577
+NAME         NUM STRINGS
ad9577
+aaaa           0 qqqqqqqqqqqqqqqqqX
ad9577
+bbb          100 dddddddddddddX
ad9577
+ccccc         21 ffffffffffffffffffffffffffffffffffffffffX
ad9577
+dddddd         3 ssssssssssX
ad9577
+ee           411 ddddddddddddddddddddddddddX
ad9577
+ffff        5111 jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjX
ad9577
+gggggg 678993321 mmmmmmmmmmmmmmmmmmmX
ad9577
+hhh      7666666 lllllllllllllllllllllllllllllllllllllX
ad9577
+iiiiii      8765 yyyyyyyyyyyyyyyyyyyyyyyyyyyyX
ad9577
+jj        987456 pppppppppX
ad9577
diff --git a/tests/expected/libsmartcols/fromfile-right-maxout b/tests/expected/libsmartcols/fromfile-right-maxout
ad9577
new file mode 100644
ad9577
index 000000000..3bcb65abd
ad9577
--- /dev/null
ad9577
+++ b/tests/expected/libsmartcols/fromfile-right-maxout
ad9577
@@ -0,0 +1,11 @@
ad9577
+NAME                                                                         NUM
ad9577
+aaaa                                                                           0
ad9577
+bbb                                                                          100
ad9577
+ccccc                                                                         21
ad9577
+dddddd                                                                         3
ad9577
+ee                                                                           411
ad9577
+ffff                                                                        5111
ad9577
+gggggg                                                                 678993321
ad9577
+hhh                                                                      7666666
ad9577
+iiiiii                                                                      8765
ad9577
+jj                                                                        987456
ad9577
diff --git a/tests/expected/libsmartcols/fromfile-strictwidth b/tests/expected/libsmartcols/fromfile-strictwidth
ad9577
new file mode 100644
ad9577
index 000000000..41054b235
ad9577
--- /dev/null
ad9577
+++ b/tests/expected/libsmartcols/fromfile-strictwidth
ad9577
@@ -0,0 +1,11 @@
ad9577
+NAME                 STRICT       NUM
ad9577
+aaaa                      0         0
ad9577
+bbb                       1       100
ad9577
+ccccc                     2        21
ad9577
+dddddd                    3         3
ad9577
+ee                        4       411
ad9577
+ffff                      5      5111
ad9577
+gggggg                    6 678993321
ad9577
+hhh                       7   7666666
ad9577
+iiiiii                    8      8765
ad9577
+jj                        9    987456
ad9577
diff --git a/tests/expected/libsmartcols/fromfile-tree b/tests/expected/libsmartcols/fromfile-tree
ad9577
new file mode 100644
ad9577
index 000000000..9d345f8dc
ad9577
--- /dev/null
ad9577
+++ b/tests/expected/libsmartcols/fromfile-tree
ad9577
@@ -0,0 +1,11 @@
ad9577
+TREE           ID PARENT STRINGS
ad9577
+aaaa            1      0 qqqqqqqqqqqqqqqqqX
ad9577
+|-bbb           2      1 dddddddddddddX
ad9577
+| |-ee          5      2 ddddddddddddddddddddddddddX
ad9577
+| `-ffff        6      2 jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjX
ad9577
+|-ccccc         3      1 ffffffffffffffffffffffffffffffffffffffffX
ad9577
+| `-gggggg      7      3 mmmmmmmmmmmmmmmmmmmX
ad9577
+|   |-hhh       8      7 lllllllllllllllllllllllllllllllllllllX
ad9577
+|   | `-iiiiii  9      8 yyyyyyyyyyyyyyyyyyyyyyyyyyyyX
ad9577
+|   `-jj       10      7 pppppppppX
ad9577
+`-dddddd        4      1 ssssssssssX
ad9577
diff --git a/tests/expected/libsmartcols/fromfile-tree-end b/tests/expected/libsmartcols/fromfile-tree-end
ad9577
new file mode 100644
ad9577
index 000000000..41aebff56
ad9577
--- /dev/null
ad9577
+++ b/tests/expected/libsmartcols/fromfile-tree-end
ad9577
@@ -0,0 +1,11 @@
ad9577
+ID PARENT STRINGS                                            TREE
ad9577
+ 1      0 qqqqqqqqqqqqqqqqqX                                 aaaa
ad9577
+ 2      1 dddddddddddddX                                     |-bbb
ad9577
+ 5      2 ddddddddddddddddddddddddddX                        | |-ee
ad9577
+ 6      2 jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjX | `-ffff
ad9577
+ 3      1 ffffffffffffffffffffffffffffffffffffffffX          |-ccccc
ad9577
+ 7      3 mmmmmmmmmmmmmmmmmmmX                               | `-gggggg
ad9577
+ 8      7 lllllllllllllllllllllllllllllllllllllX             |   |-hhh
ad9577
+ 9      8 yyyyyyyyyyyyyyyyyyyyyyyyyyyyX                      |   | `-iiiiii
ad9577
+10      7 pppppppppX                                         |   `-jj
ad9577
+ 4      1 ssssssssssX                                        `-dddddd
ad9577
diff --git a/tests/expected/libsmartcols/fromfile-tree-json b/tests/expected/libsmartcols/fromfile-tree-json
ad9577
new file mode 100644
ad9577
index 000000000..5b3546d0a
ad9577
--- /dev/null
ad9577
+++ b/tests/expected/libsmartcols/fromfile-tree-json
ad9577
@@ -0,0 +1,29 @@
ad9577
+{
ad9577
+   "testtable": [
ad9577
+      {"tree":"aaaa", "id":"1", "parent":"0", "strings":"qqqqqqqqqqqqqqqqqX",
ad9577
+         "children": [
ad9577
+            {"tree":"bbb", "id":"2", "parent":"1", "strings":"dddddddddddddX",
ad9577
+               "children": [
ad9577
+                  {"tree":"ee", "id":"5", "parent":"2", "strings":"ddddddddddddddddddddddddddX"},
ad9577
+                  {"tree":"ffff", "id":"6", "parent":"2", "strings":"jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjX"}
ad9577
+               ]
ad9577
+            },
ad9577
+            {"tree":"ccccc", "id":"3", "parent":"1", "strings":"ffffffffffffffffffffffffffffffffffffffffX",
ad9577
+               "children": [
ad9577
+                  {"tree":"gggggg", "id":"7", "parent":"3", "strings":"mmmmmmmmmmmmmmmmmmmX",
ad9577
+                     "children": [
ad9577
+                        {"tree":"hhh", "id":"8", "parent":"7", "strings":"lllllllllllllllllllllllllllllllllllllX",
ad9577
+                           "children": [
ad9577
+                              {"tree":"iiiiii", "id":"9", "parent":"8", "strings":"yyyyyyyyyyyyyyyyyyyyyyyyyyyyX"}
ad9577
+                           ]
ad9577
+                        },
ad9577
+                        {"tree":"jj", "id":"10", "parent":"7", "strings":"pppppppppX"}
ad9577
+                     ]
ad9577
+                  }
ad9577
+               ]
ad9577
+            },
ad9577
+            {"tree":"dddddd", "id":"4", "parent":"1", "strings":"ssssssssssX"}
ad9577
+         ]
ad9577
+      }
ad9577
+   ]
ad9577
+}
ad9577
diff --git a/tests/expected/libsmartcols/fromfile-tree-middle b/tests/expected/libsmartcols/fromfile-tree-middle
ad9577
new file mode 100644
ad9577
index 000000000..b2183313c
ad9577
--- /dev/null
ad9577
+++ b/tests/expected/libsmartcols/fromfile-tree-middle
ad9577
@@ -0,0 +1,11 @@
ad9577
+ID PARENT TREE           STRINGS
ad9577
+ 1      0 aaaa           qqqqqqqqqqqqqqqqqX
ad9577
+ 2      1 |-bbb          dddddddddddddX
ad9577
+ 5      2 | |-ee         ddddddddddddddddddddddddddX
ad9577
+ 6      2 | `-ffff       jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjX
ad9577
+ 3      1 |-ccccc        ffffffffffffffffffffffffffffffffffffffffX
ad9577
+ 7      3 | `-gggggg     mmmmmmmmmmmmmmmmmmmX
ad9577
+ 8      7 |   |-hhh      lllllllllllllllllllllllllllllllllllllX
ad9577
+ 9      8 |   | `-iiiiii yyyyyyyyyyyyyyyyyyyyyyyyyyyyX
ad9577
+10      7 |   `-jj       pppppppppX
ad9577
+ 4      1 `-dddddd       ssssssssssX
ad9577
diff --git a/tests/expected/libsmartcols/fromfile-trunc b/tests/expected/libsmartcols/fromfile-trunc
ad9577
new file mode 100644
ad9577
index 000000000..6a095dc88
ad9577
--- /dev/null
ad9577
+++ b/tests/expected/libsmartcols/fromfile-trunc
ad9577
@@ -0,0 +1,11 @@
ad9577
+NAME         NUM TRUNC
ad9577
+aaaa           0 qqqqqqqqqqqqqqqqqX
ad9577
+bbb          100 dddddddddddddX
ad9577
+ccccc         21 fffffffffffffffffffffff
ad9577
+dddddd         3 ssssssssssX
ad9577
+ee           411 ddddddddddddddddddddddd
ad9577
+ffff        5111 jjjjjjjjjjjjjjjjjjjjjjj
ad9577
+gggggg 678993321 mmmmmmmmmmmmmmmmmmmX
ad9577
+hhh      7666666 lllllllllllllllllllllll
ad9577
+iiiiii      8765 yyyyyyyyyyyyyyyyyyyyyyy
ad9577
+jj        987456 pppppppppX
ad9577
diff --git a/tests/expected/libsmartcols/fromfile-wrap b/tests/expected/libsmartcols/fromfile-wrap
ad9577
new file mode 100644
ad9577
index 000000000..bb94f4973
ad9577
--- /dev/null
ad9577
+++ b/tests/expected/libsmartcols/fromfile-wrap
ad9577
@@ -0,0 +1,17 @@
ad9577
+NAME         NUM WRAP
ad9577
+aaaa           0 qqqqqqqqqqqqqqqqqX
ad9577
+bbb          100 dddddddddddddX
ad9577
+ccccc         21 fffffffffffffffffffffff
ad9577
+                 fffffffffffffffffX
ad9577
+dddddd         3 ssssssssssX
ad9577
+ee           411 ddddddddddddddddddddddd
ad9577
+                 dddX
ad9577
+ffff        5111 jjjjjjjjjjjjjjjjjjjjjjj
ad9577
+                 jjjjjjjjjjjjjjjjjjjjjjj
ad9577
+                 jjjX
ad9577
+gggggg 678993321 mmmmmmmmmmmmmmmmmmmX
ad9577
+hhh      7666666 lllllllllllllllllllllll
ad9577
+                 llllllllllllllX
ad9577
+iiiiii      8765 yyyyyyyyyyyyyyyyyyyyyyy
ad9577
+                 yyyyyX
ad9577
+jj        987456 pppppppppX
ad9577
diff --git a/tests/expected/libsmartcols/fromfile-wrap-tree b/tests/expected/libsmartcols/fromfile-wrap-tree
ad9577
new file mode 100644
ad9577
index 000000000..a2db7a4ac
ad9577
--- /dev/null
ad9577
+++ b/tests/expected/libsmartcols/fromfile-wrap-tree
ad9577
@@ -0,0 +1,18 @@
ad9577
+TREE           ID PARENT WRAP
ad9577
+aaaa            1      0 qqqqqqqqqqqqqqqqqX
ad9577
+|-bbb           2      1 dddddddddddddX
ad9577
+| |-ee          5      2 dddddddddddddddddddd
ad9577
+| |                      ddddddX
ad9577
+| `-ffff        6      2 jjjjjjjjjjjjjjjjjjjj
ad9577
+|                        jjjjjjjjjjjjjjjjjjjj
ad9577
+|                        jjjjjjjjjX
ad9577
+|-ccccc         3      1 ffffffffffffffffffff
ad9577
+| |                      ffffffffffffffffffff
ad9577
+| |                      X
ad9577
+| `-gggggg      7      3 mmmmmmmmmmmmmmmmmmmX
ad9577
+|   |-hhh       8      7 llllllllllllllllllll
ad9577
+|   | |                  lllllllllllllllllX
ad9577
+|   | `-iiiiii  9      8 yyyyyyyyyyyyyyyyyyyy
ad9577
+|   |                    yyyyyyyyX
ad9577
+|   `-jj       10      7 pppppppppX
ad9577
+`-dddddd        4      1 ssssssssssX
ad9577
diff --git a/tests/expected/libsmartcols/fromfile-wrapnl b/tests/expected/libsmartcols/fromfile-wrapnl
ad9577
new file mode 100644
ad9577
index 000000000..c747ebb08
ad9577
--- /dev/null
ad9577
+++ b/tests/expected/libsmartcols/fromfile-wrapnl
ad9577
@@ -0,0 +1,19 @@
ad9577
+NAME         NUM WRAPNL
ad9577
+aaaa           0 aaa
ad9577
+bbb          100 bbbbb
ad9577
+ccccc         21 cccc
ad9577
+                 CCCC
ad9577
+dddddd         3 dddddddd
ad9577
+                 DDDD
ad9577
+                 DD
ad9577
+ee           411 hello
ad9577
+                 baby
ad9577
+ffff        5111 aaa
ad9577
+                 bbb
ad9577
+                 ccc
ad9577
+                 ddd
ad9577
+gggggg 678993321 eee
ad9577
+hhh      7666666 fffff
ad9577
+iiiiii      8765 g
ad9577
+                 hhhhh
ad9577
+jj        987456 ppppppppp
ad9577
diff --git a/tests/expected/libsmartcols/fromfile-wrapnl-tree b/tests/expected/libsmartcols/fromfile-wrapnl-tree
ad9577
new file mode 100644
ad9577
index 000000000..3862cf16a
ad9577
--- /dev/null
ad9577
+++ b/tests/expected/libsmartcols/fromfile-wrapnl-tree
ad9577
@@ -0,0 +1,19 @@
ad9577
+TREE           ID PARENT WRAPNL
ad9577
+aaaa            1      0 aaa
ad9577
+|-bbb           2      1 bbbbb
ad9577
+| |-ee          5      2 hello
ad9577
+| |                      baby
ad9577
+| `-ffff        6      2 aaa
ad9577
+|                        bbb
ad9577
+|                        ccc
ad9577
+|                        ddd
ad9577
+|-ccccc         3      1 cccc
ad9577
+| |                      CCCC
ad9577
+| `-gggggg      7      3 eee
ad9577
+|   |-hhh       8      7 fffff
ad9577
+|   | `-iiiiii  9      8 g
ad9577
+|   |                    hhhhh
ad9577
+|   `-jj       10      7 ppppppppp
ad9577
+`-dddddd        4      1 dddddddd
ad9577
+                         DDDD
ad9577
+                         DD
ad9577
diff --git a/tests/expected/libsmartcols/title b/tests/expected/libsmartcols/title
ad9577
new file mode 100644
ad9577
index 000000000..bb5d7225a
ad9577
--- /dev/null
ad9577
+++ b/tests/expected/libsmartcols/title
ad9577
@@ -0,0 +1,16 @@
ad9577
+                                                             This is right title
ad9577
+NAME DATA
ad9577
+foo  bla bla bla
ad9577
+bar  alb alb alb
ad9577
+This is left title (without padding)
ad9577
+NAME DATA
ad9577
+foo  bla bla bla
ad9577
+bar  alb alb alb
ad9577
+=======================This is center title (with padding)======================
ad9577
+NAME DATA
ad9577
+foo  bla bla bla
ad9577
+bar  alb alb alb
ad9577
+This is left title (with padding)-----------------------------------------------
ad9577
+NAME DATA
ad9577
+foo  bla bla bla
ad9577
+bar  alb alb alb
ad9577
diff --git a/tests/ts/libsmartcols/files/col-hidden b/tests/ts/libsmartcols/files/col-hidden
ad9577
new file mode 100644
ad9577
index 000000000..83182a8ee
ad9577
--- /dev/null
ad9577
+++ b/tests/ts/libsmartcols/files/col-hidden
ad9577
@@ -0,0 +1,3 @@
ad9577
+FOO
ad9577
+0
ad9577
+hidden
ad9577
diff --git a/tests/ts/libsmartcols/files/col-id b/tests/ts/libsmartcols/files/col-id
ad9577
new file mode 100644
ad9577
index 000000000..0188f42a0
ad9577
--- /dev/null
ad9577
+++ b/tests/ts/libsmartcols/files/col-id
ad9577
@@ -0,0 +1,3 @@
ad9577
+ID
ad9577
+0
ad9577
+right
ad9577
diff --git a/tests/ts/libsmartcols/files/col-name b/tests/ts/libsmartcols/files/col-name
ad9577
new file mode 100644
ad9577
index 000000000..0a98f29cf
ad9577
--- /dev/null
ad9577
+++ b/tests/ts/libsmartcols/files/col-name
ad9577
@@ -0,0 +1,3 @@
ad9577
+NAME
ad9577
+0
ad9577
+none
ad9577
diff --git a/tests/ts/libsmartcols/files/col-noextremes b/tests/ts/libsmartcols/files/col-noextremes
ad9577
new file mode 100644
ad9577
index 000000000..715edce7e
ad9577
--- /dev/null
ad9577
+++ b/tests/ts/libsmartcols/files/col-noextremes
ad9577
@@ -0,0 +1,3 @@
ad9577
+NOEXTREME
ad9577
+0
ad9577
+noextremes
ad9577
diff --git a/tests/ts/libsmartcols/files/col-number b/tests/ts/libsmartcols/files/col-number
ad9577
new file mode 100644
ad9577
index 000000000..34a70e4a4
ad9577
--- /dev/null
ad9577
+++ b/tests/ts/libsmartcols/files/col-number
ad9577
@@ -0,0 +1,3 @@
ad9577
+NUM
ad9577
+0
ad9577
+right
ad9577
diff --git a/tests/ts/libsmartcols/files/col-parent b/tests/ts/libsmartcols/files/col-parent
ad9577
new file mode 100644
ad9577
index 000000000..86fe08ced
ad9577
--- /dev/null
ad9577
+++ b/tests/ts/libsmartcols/files/col-parent
ad9577
@@ -0,0 +1,3 @@
ad9577
+PARENT
ad9577
+0
ad9577
+right
ad9577
diff --git a/tests/ts/libsmartcols/files/col-strict b/tests/ts/libsmartcols/files/col-strict
ad9577
new file mode 100644
ad9577
index 000000000..62bb96b9a
ad9577
--- /dev/null
ad9577
+++ b/tests/ts/libsmartcols/files/col-strict
ad9577
@@ -0,0 +1,3 @@
ad9577
+STRICT
ad9577
+20
ad9577
+strictwidth,right
ad9577
diff --git a/tests/ts/libsmartcols/files/col-string b/tests/ts/libsmartcols/files/col-string
ad9577
new file mode 100644
ad9577
index 000000000..7e2904b9f
ad9577
--- /dev/null
ad9577
+++ b/tests/ts/libsmartcols/files/col-string
ad9577
@@ -0,0 +1,3 @@
ad9577
+STRINGS
ad9577
+0
ad9577
+none
ad9577
diff --git a/tests/ts/libsmartcols/files/col-tree b/tests/ts/libsmartcols/files/col-tree
ad9577
new file mode 100644
ad9577
index 000000000..507688000
ad9577
--- /dev/null
ad9577
+++ b/tests/ts/libsmartcols/files/col-tree
ad9577
@@ -0,0 +1,3 @@
ad9577
+TREE
ad9577
+0
ad9577
+tree
ad9577
diff --git a/tests/ts/libsmartcols/files/col-trunc b/tests/ts/libsmartcols/files/col-trunc
ad9577
new file mode 100644
ad9577
index 000000000..2887b4314
ad9577
--- /dev/null
ad9577
+++ b/tests/ts/libsmartcols/files/col-trunc
ad9577
@@ -0,0 +1,3 @@
ad9577
+TRUNC
ad9577
+0
ad9577
+trunc
ad9577
diff --git a/tests/ts/libsmartcols/files/col-wrap b/tests/ts/libsmartcols/files/col-wrap
ad9577
new file mode 100644
ad9577
index 000000000..dc4ca340e
ad9577
--- /dev/null
ad9577
+++ b/tests/ts/libsmartcols/files/col-wrap
ad9577
@@ -0,0 +1,3 @@
ad9577
+WRAP
ad9577
+0
ad9577
+wrap
ad9577
diff --git a/tests/ts/libsmartcols/files/col-wrapnl b/tests/ts/libsmartcols/files/col-wrapnl
ad9577
new file mode 100644
ad9577
index 000000000..0a18fd146
ad9577
--- /dev/null
ad9577
+++ b/tests/ts/libsmartcols/files/col-wrapnl
ad9577
@@ -0,0 +1,3 @@
ad9577
+WRAPNL
ad9577
+0
ad9577
+wrapnl
ad9577
diff --git a/tests/ts/libsmartcols/files/data-id b/tests/ts/libsmartcols/files/data-id
ad9577
new file mode 100644
ad9577
index 000000000..f00c965d8
ad9577
--- /dev/null
ad9577
+++ b/tests/ts/libsmartcols/files/data-id
ad9577
@@ -0,0 +1,10 @@
ad9577
+1
ad9577
+2
ad9577
+3
ad9577
+4
ad9577
+5
ad9577
+6
ad9577
+7
ad9577
+8
ad9577
+9
ad9577
+10
ad9577
diff --git a/tests/ts/libsmartcols/files/data-number b/tests/ts/libsmartcols/files/data-number
ad9577
new file mode 100644
ad9577
index 000000000..562d75061
ad9577
--- /dev/null
ad9577
+++ b/tests/ts/libsmartcols/files/data-number
ad9577
@@ -0,0 +1,10 @@
ad9577
+0
ad9577
+100
ad9577
+21
ad9577
+3
ad9577
+411
ad9577
+5111
ad9577
+678993321
ad9577
+7666666
ad9577
+8765
ad9577
+987456
ad9577
diff --git a/tests/ts/libsmartcols/files/data-number-tiny b/tests/ts/libsmartcols/files/data-number-tiny
ad9577
new file mode 100644
ad9577
index 000000000..8b1acc12b
ad9577
--- /dev/null
ad9577
+++ b/tests/ts/libsmartcols/files/data-number-tiny
ad9577
@@ -0,0 +1,10 @@
ad9577
+0
ad9577
+1
ad9577
+2
ad9577
+3
ad9577
+4
ad9577
+5
ad9577
+6
ad9577
+7
ad9577
+8
ad9577
+9
ad9577
diff --git a/tests/ts/libsmartcols/files/data-parent b/tests/ts/libsmartcols/files/data-parent
ad9577
new file mode 100644
ad9577
index 000000000..aa5071608
ad9577
--- /dev/null
ad9577
+++ b/tests/ts/libsmartcols/files/data-parent
ad9577
@@ -0,0 +1,10 @@
ad9577
+0
ad9577
+1
ad9577
+1
ad9577
+1
ad9577
+2
ad9577
+2
ad9577
+3
ad9577
+7
ad9577
+8
ad9577
+7
ad9577
diff --git a/tests/ts/libsmartcols/files/data-string b/tests/ts/libsmartcols/files/data-string
ad9577
new file mode 100644
ad9577
index 000000000..dff6e9c80
ad9577
--- /dev/null
ad9577
+++ b/tests/ts/libsmartcols/files/data-string
ad9577
@@ -0,0 +1,10 @@
ad9577
+aaaa
ad9577
+bbb
ad9577
+ccccc
ad9577
+dddddd
ad9577
+ee
ad9577
+ffff
ad9577
+gggggg
ad9577
+hhh
ad9577
+iiiiii
ad9577
+jj
ad9577
diff --git a/tests/ts/libsmartcols/files/data-string-extreme b/tests/ts/libsmartcols/files/data-string-extreme
ad9577
new file mode 100644
ad9577
index 000000000..6fb395d7a
ad9577
--- /dev/null
ad9577
+++ b/tests/ts/libsmartcols/files/data-string-extreme
ad9577
@@ -0,0 +1,10 @@
ad9577
+qqqqqqX
ad9577
+ddddddddX
ad9577
+ffffffffffffffffffffffffffffffffffX
ad9577
+sssX
ad9577
+ddX
ad9577
+jjjjjX
ad9577
+mmmmmmmX
ad9577
+llllllllllX
ad9577
+yyyyyyX
ad9577
+pppppX
ad9577
diff --git a/tests/ts/libsmartcols/files/data-string-long b/tests/ts/libsmartcols/files/data-string-long
ad9577
new file mode 100644
ad9577
index 000000000..1b5683aa4
ad9577
--- /dev/null
ad9577
+++ b/tests/ts/libsmartcols/files/data-string-long
ad9577
@@ -0,0 +1,10 @@
ad9577
+qqqqqqqqqqqqqqqqqX
ad9577
+dddddddddddddX
ad9577
+ffffffffffffffffffffffffffffffffffffffffX
ad9577
+ssssssssssX
ad9577
+ddddddddddddddddddddddddddX
ad9577
+jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjX
ad9577
+mmmmmmmmmmmmmmmmmmmX
ad9577
+lllllllllllllllllllllllllllllllllllllX
ad9577
+yyyyyyyyyyyyyyyyyyyyyyyyyyyyX
ad9577
+pppppppppX
ad9577
diff --git a/tests/ts/libsmartcols/files/data-string-nl b/tests/ts/libsmartcols/files/data-string-nl
ad9577
new file mode 100644
ad9577
index 000000000..7822e57bc
ad9577
--- /dev/null
ad9577
+++ b/tests/ts/libsmartcols/files/data-string-nl
ad9577
@@ -0,0 +1,10 @@
ad9577
+aaa
ad9577
+bbbbb
ad9577
+cccc\nCCCC
ad9577
+dddddddd\nDDDD\nDD
ad9577
+hello\nbaby
ad9577
+aaa\nbbb\nccc\nddd
ad9577
+eee
ad9577
+fffff
ad9577
+g\nhhhhh
ad9577
+ppppppppp
ad9577
diff --git a/tests/ts/libsmartcols/fromfile b/tests/ts/libsmartcols/fromfile
ad9577
new file mode 100755
ad9577
index 000000000..311dd7e1e
ad9577
--- /dev/null
ad9577
+++ b/tests/ts/libsmartcols/fromfile
ad9577
@@ -0,0 +1,240 @@
ad9577
+#!/bin/bash
ad9577
+#
ad9577
+# This file is part of util-linux.
ad9577
+#
ad9577
+# This file is free software; you can redistribute it and/or modify
ad9577
+# it under the terms of the GNU General Public License as published by
ad9577
+# the Free Software Foundation; either version 2 of the License, or
ad9577
+# (at your option) any later version.
ad9577
+#
ad9577
+# This file is distributed in the hope that it will be useful,
ad9577
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
ad9577
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
ad9577
+# GNU General Public License for more details.
ad9577
+#
ad9577
+#
ad9577
+
ad9577
+TS_TOPDIR="${0%/*}/../.."
ad9577
+TS_DESC="fromfile"
ad9577
+
ad9577
+. $TS_TOPDIR/functions.sh
ad9577
+ts_init "$*"
ad9577
+
ad9577
+TESTPROG="$TS_HELPER_LIBSMARTCOLS_FROMFILE"
ad9577
+ts_check_test_command "$TESTPROG"
ad9577
+
ad9577
+ts_init_subtest "tree"
ad9577
+$TESTPROG --nlines 10 \
ad9577
+	--tree-id-column 1 \
ad9577
+	--tree-parent-column 2 \
ad9577
+	--column $TS_SELF/files/col-tree \
ad9577
+	--column $TS_SELF/files/col-id \
ad9577
+	--column $TS_SELF/files/col-parent \
ad9577
+	--column $TS_SELF/files/col-string \
ad9577
+	$TS_SELF/files/data-string \
ad9577
+	$TS_SELF/files/data-id \
ad9577
+	$TS_SELF/files/data-parent \
ad9577
+	$TS_SELF/files/data-string-long \
ad9577
+	>> $TS_OUTPUT 2>&1
ad9577
+ts_finalize_subtest
ad9577
+
ad9577
+ts_init_subtest "tree-json"
ad9577
+$TESTPROG --nlines 10 --json \
ad9577
+	--tree-id-column 1 \
ad9577
+	--tree-parent-column 2 \
ad9577
+	--column $TS_SELF/files/col-tree \
ad9577
+	--column $TS_SELF/files/col-id \
ad9577
+	--column $TS_SELF/files/col-parent \
ad9577
+	--column $TS_SELF/files/col-string \
ad9577
+	$TS_SELF/files/data-string \
ad9577
+	$TS_SELF/files/data-id \
ad9577
+	$TS_SELF/files/data-parent \
ad9577
+	$TS_SELF/files/data-string-long \
ad9577
+	>> $TS_OUTPUT 2>&1
ad9577
+ts_finalize_subtest
ad9577
+
ad9577
+ts_init_subtest "tree-middle"
ad9577
+$TESTPROG --nlines 10 \
ad9577
+	--tree-id-column 0 \
ad9577
+	--tree-parent-column 1 \
ad9577
+	--column $TS_SELF/files/col-id \
ad9577
+	--column $TS_SELF/files/col-parent \
ad9577
+	--column $TS_SELF/files/col-tree \
ad9577
+	--column $TS_SELF/files/col-string \
ad9577
+	$TS_SELF/files/data-id \
ad9577
+	$TS_SELF/files/data-parent \
ad9577
+	$TS_SELF/files/data-string \
ad9577
+	$TS_SELF/files/data-string-long \
ad9577
+	>> $TS_OUTPUT 2>&1
ad9577
+ts_finalize_subtest
ad9577
+
ad9577
+ts_init_subtest "tree-end"
ad9577
+$TESTPROG --nlines 10 \
ad9577
+	--tree-id-column 0 \
ad9577
+	--tree-parent-column 1 \
ad9577
+	--column $TS_SELF/files/col-id \
ad9577
+	--column $TS_SELF/files/col-parent \
ad9577
+	--column $TS_SELF/files/col-string \
ad9577
+	--column $TS_SELF/files/col-tree \
ad9577
+	$TS_SELF/files/data-id \
ad9577
+	$TS_SELF/files/data-parent \
ad9577
+	$TS_SELF/files/data-string-long \
ad9577
+	$TS_SELF/files/data-string \
ad9577
+	>> $TS_OUTPUT 2>&1
ad9577
+ts_finalize_subtest
ad9577
+
ad9577
+ts_init_subtest "trunc"
ad9577
+$TESTPROG --nlines 10 --width 40 \
ad9577
+	--column $TS_SELF/files/col-name \
ad9577
+	--column $TS_SELF/files/col-number \
ad9577
+	--column $TS_SELF/files/col-trunc \
ad9577
+	$TS_SELF/files/data-string \
ad9577
+	$TS_SELF/files/data-number \
ad9577
+	$TS_SELF/files/data-string-long \
ad9577
+	>> $TS_OUTPUT 2>&1
ad9577
+ts_finalize_subtest
ad9577
+
ad9577
+ts_init_subtest "right"
ad9577
+$TESTPROG --nlines 10 \
ad9577
+	--column $TS_SELF/files/col-name \
ad9577
+	--column $TS_SELF/files/col-number \
ad9577
+	--column $TS_SELF/files/col-string \
ad9577
+	$TS_SELF/files/data-string \
ad9577
+	$TS_SELF/files/data-number \
ad9577
+	$TS_SELF/files/data-string-long \
ad9577
+	>> $TS_OUTPUT 2>&1
ad9577
+ts_finalize_subtest
ad9577
+
ad9577
+ts_init_subtest "right-maxout"
ad9577
+$TESTPROG --nlines 10 --maxout --width 80\
ad9577
+	--column $TS_SELF/files/col-name \
ad9577
+	--column $TS_SELF/files/col-number \
ad9577
+	$TS_SELF/files/data-string \
ad9577
+	$TS_SELF/files/data-number \
ad9577
+	>> $TS_OUTPUT 2>&1
ad9577
+ts_finalize_subtest
ad9577
+
ad9577
+ts_init_subtest "strictwidth"
ad9577
+$TESTPROG --nlines 10 \
ad9577
+	--column $TS_SELF/files/col-name \
ad9577
+	--column $TS_SELF/files/col-strict \
ad9577
+	--column $TS_SELF/files/col-number \
ad9577
+	$TS_SELF/files/data-string \
ad9577
+	$TS_SELF/files/data-number-tiny \
ad9577
+	$TS_SELF/files/data-number \
ad9577
+	>> $TS_OUTPUT 2>&1
ad9577
+ts_finalize_subtest
ad9577
+
ad9577
+ts_init_subtest "noextremes"
ad9577
+$TESTPROG --nlines 10 --width 45 \
ad9577
+	--column $TS_SELF/files/col-name \
ad9577
+	--column $TS_SELF/files/col-noextremes \
ad9577
+	--column $TS_SELF/files/col-number \
ad9577
+	--column $TS_SELF/files/col-name \
ad9577
+	--column $TS_SELF/files/col-number \
ad9577
+	$TS_SELF/files/data-string \
ad9577
+	$TS_SELF/files/data-string-extreme \
ad9577
+	$TS_SELF/files/data-number \
ad9577
+	$TS_SELF/files/data-string \
ad9577
+	$TS_SELF/files/data-number \
ad9577
+	>> $TS_OUTPUT 2>&1
ad9577
+ts_finalize_subtest
ad9577
+
ad9577
+ts_init_subtest "hidden"
ad9577
+$TESTPROG --nlines 10 \
ad9577
+	--column $TS_SELF/files/col-name \
ad9577
+	--column $TS_SELF/files/col-hidden \
ad9577
+	--column $TS_SELF/files/col-number \
ad9577
+	$TS_SELF/files/data-string \
ad9577
+	$TS_SELF/files/data-string-long \
ad9577
+	$TS_SELF/files/data-number \
ad9577
+	>> $TS_OUTPUT 2>&1
ad9577
+ts_finalize_subtest
ad9577
+
ad9577
+ts_init_subtest "wrap"
ad9577
+$TESTPROG --nlines 10 --width 40 \
ad9577
+	--column $TS_SELF/files/col-name \
ad9577
+	--column $TS_SELF/files/col-number \
ad9577
+	--column $TS_SELF/files/col-wrap \
ad9577
+	$TS_SELF/files/data-string \
ad9577
+	$TS_SELF/files/data-number \
ad9577
+	$TS_SELF/files/data-string-long \
ad9577
+	>> $TS_OUTPUT 2>&1
ad9577
+ts_finalize_subtest
ad9577
+
ad9577
+ts_init_subtest "wrap-tree"
ad9577
+$TESTPROG --nlines 10 --width 45 \
ad9577
+	--tree-id-column 1 \
ad9577
+	--tree-parent-column 2 \
ad9577
+	--column $TS_SELF/files/col-tree \
ad9577
+	--column $TS_SELF/files/col-id \
ad9577
+	--column $TS_SELF/files/col-parent \
ad9577
+	--column $TS_SELF/files/col-wrap \
ad9577
+	$TS_SELF/files/data-string \
ad9577
+	$TS_SELF/files/data-id \
ad9577
+	$TS_SELF/files/data-parent \
ad9577
+	$TS_SELF/files/data-string-long \
ad9577
+	>> $TS_OUTPUT 2>&1
ad9577
+ts_finalize_subtest
ad9577
+
ad9577
+ts_init_subtest "wrapnl"
ad9577
+$TESTPROG --nlines 10 \
ad9577
+	--column $TS_SELF/files/col-name \
ad9577
+	--column $TS_SELF/files/col-number \
ad9577
+	--column $TS_SELF/files/col-wrapnl \
ad9577
+	$TS_SELF/files/data-string \
ad9577
+	$TS_SELF/files/data-number \
ad9577
+	$TS_SELF/files/data-string-nl \
ad9577
+	>> $TS_OUTPUT 2>&1
ad9577
+ts_finalize_subtest
ad9577
+
ad9577
+ts_init_subtest "wrapnl-tree"
ad9577
+$TESTPROG --nlines 10 \
ad9577
+	--tree-id-column 1 \
ad9577
+	--tree-parent-column 2 \
ad9577
+	--column $TS_SELF/files/col-tree \
ad9577
+	--column $TS_SELF/files/col-id \
ad9577
+	--column $TS_SELF/files/col-parent \
ad9577
+	--column $TS_SELF/files/col-wrapnl \
ad9577
+	$TS_SELF/files/data-string \
ad9577
+	$TS_SELF/files/data-id \
ad9577
+	$TS_SELF/files/data-parent \
ad9577
+	$TS_SELF/files/data-string-nl \
ad9577
+	>> $TS_OUTPUT 2>&1
ad9577
+ts_finalize_subtest
ad9577
+
ad9577
+ts_init_subtest "raw"
ad9577
+$TESTPROG --nlines 10 --raw \
ad9577
+	--column $TS_SELF/files/col-name \
ad9577
+	--column $TS_SELF/files/col-number \
ad9577
+	--column $TS_SELF/files/col-trunc \
ad9577
+	$TS_SELF/files/data-string \
ad9577
+	$TS_SELF/files/data-number \
ad9577
+	$TS_SELF/files/data-string-long \
ad9577
+	>> $TS_OUTPUT 2>&1
ad9577
+ts_finalize_subtest
ad9577
+
ad9577
+ts_init_subtest "export"
ad9577
+$TESTPROG --nlines 10 --export \
ad9577
+	--column $TS_SELF/files/col-name \
ad9577
+	--column $TS_SELF/files/col-number \
ad9577
+	--column $TS_SELF/files/col-trunc \
ad9577
+	$TS_SELF/files/data-string \
ad9577
+	$TS_SELF/files/data-number \
ad9577
+	$TS_SELF/files/data-string-long \
ad9577
+	>> $TS_OUTPUT 2>&1
ad9577
+ts_finalize_subtest
ad9577
+
ad9577
+ts_init_subtest "column-separator"
ad9577
+$TESTPROG --nlines 10 --colsep \| \
ad9577
+	--column $TS_SELF/files/col-name \
ad9577
+	--column $TS_SELF/files/col-number \
ad9577
+	--column $TS_SELF/files/col-trunc \
ad9577
+	$TS_SELF/files/data-string \
ad9577
+	$TS_SELF/files/data-number \
ad9577
+	$TS_SELF/files/data-string-long \
ad9577
+	>> $TS_OUTPUT 2>&1
ad9577
+ts_finalize_subtest
ad9577
+
ad9577
+ts_log "...done."
ad9577
+ts_finalize
ad9577
diff --git a/tests/ts/libsmartcols/title b/tests/ts/libsmartcols/title
ad9577
new file mode 100755
ad9577
index 000000000..a9ba6a4fd
ad9577
--- /dev/null
ad9577
+++ b/tests/ts/libsmartcols/title
ad9577
@@ -0,0 +1,28 @@
ad9577
+#!/bin/bash
ad9577
+#
ad9577
+# This file is part of util-linux.
ad9577
+#
ad9577
+# This file is free software; you can redistribute it and/or modify
ad9577
+# it under the terms of the GNU General Public License as published by
ad9577
+# the Free Software Foundation; either version 2 of the License, or
ad9577
+# (at your option) any later version.
ad9577
+#
ad9577
+# This file is distributed in the hope that it will be useful,
ad9577
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
ad9577
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
ad9577
+# GNU General Public License for more details.
ad9577
+#
ad9577
+#
ad9577
+
ad9577
+TS_TOPDIR="${0%/*}/../.."
ad9577
+TS_DESC="title"
ad9577
+
ad9577
+. $TS_TOPDIR/functions.sh
ad9577
+ts_init "$*"
ad9577
+
ad9577
+TESTPROG="$TS_HELPER_LIBSMARTCOLS_TITLE"
ad9577
+ts_check_test_command "$TESTPROG"
ad9577
+
ad9577
+$TESTPROG --width 80 >> $TS_OUTPUT 2>&1
ad9577
+
ad9577
+ts_finalize
ad9577
-- 
ad9577
2.14.4
ad9577