dcavalca / rpms / util-linux

Forked from rpms/util-linux 2 years ago
Clone

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

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