dcavalca / rpms / util-linux

Forked from rpms/util-linux 2 years ago
Clone

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

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