summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xtests.sh5
-rw-r--r--tests/test_printf_H.out31
2 files changed, 36 insertions, 0 deletions
diff --git a/tests.sh b/tests.sh
index a4068d6..11c1057 100755
--- a/tests.sh
+++ b/tests.sh
@@ -481,6 +481,7 @@ gnu_tests=(
test_printf_leak
test_printf_nul
test_printf_Y_error
+ test_printf_H
test_quit
test_quit_child
@@ -1789,6 +1790,10 @@ function test_printf_Y_error() {
[ $ret -eq $EX_BFS ]
}
+function test_printf_H() {
+ bfs_diff basic links -printf '%%p(%p) %%d(%d) %%f(%f) %%h(%h) %%H(%H) %%P(%P) %%m(%m) %%M(%M) %%y(%y)\n'
+}
+
function test_fstype() {
fstype="$(invoke_bfs basic -maxdepth 0 -printf '%F\n')"
bfs_diff basic -fstype "$fstype"
diff --git a/tests/test_printf_H.out b/tests/test_printf_H.out
new file mode 100644
index 0000000..8e09557
--- /dev/null
+++ b/tests/test_printf_H.out
@@ -0,0 +1,31 @@
+%p(basic) %d(0) %f(basic) %h(.) %H(basic) %P() %m(755) %M(drwxr-xr-x) %y(d)
+%p(links) %d(0) %f(links) %h(.) %H(links) %P() %m(755) %M(drwxr-xr-x) %y(d)
+%p(basic/a) %d(1) %f(a) %h(basic) %H(basic) %P(a) %m(644) %M(-rw-r--r--) %y(f)
+%p(basic/b) %d(1) %f(b) %h(basic) %H(basic) %P(b) %m(644) %M(-rw-r--r--) %y(f)
+%p(basic/c) %d(1) %f(c) %h(basic) %H(basic) %P(c) %m(755) %M(drwxr-xr-x) %y(d)
+%p(basic/e) %d(1) %f(e) %h(basic) %H(basic) %P(e) %m(755) %M(drwxr-xr-x) %y(d)
+%p(basic/g) %d(1) %f(g) %h(basic) %H(basic) %P(g) %m(755) %M(drwxr-xr-x) %y(d)
+%p(basic/i) %d(1) %f(i) %h(basic) %H(basic) %P(i) %m(755) %M(drwxr-xr-x) %y(d)
+%p(basic/j) %d(1) %f(j) %h(basic) %H(basic) %P(j) %m(755) %M(drwxr-xr-x) %y(d)
+%p(basic/k) %d(1) %f(k) %h(basic) %H(basic) %P(k) %m(755) %M(drwxr-xr-x) %y(d)
+%p(basic/l) %d(1) %f(l) %h(basic) %H(basic) %P(l) %m(755) %M(drwxr-xr-x) %y(d)
+%p(links/broken) %d(1) %f(broken) %h(links) %H(links) %P(broken) %m(777) %M(lrwxrwxrwx) %y(l)
+%p(links/deeply) %d(1) %f(deeply) %h(links) %H(links) %P(deeply) %m(755) %M(drwxr-xr-x) %y(d)
+%p(links/file) %d(1) %f(file) %h(links) %H(links) %P(file) %m(644) %M(-rw-r--r--) %y(f)
+%p(links/hardlink) %d(1) %f(hardlink) %h(links) %H(links) %P(hardlink) %m(644) %M(-rw-r--r--) %y(f)
+%p(links/notdir) %d(1) %f(notdir) %h(links) %H(links) %P(notdir) %m(777) %M(lrwxrwxrwx) %y(l)
+%p(links/skip) %d(1) %f(skip) %h(links) %H(links) %P(skip) %m(777) %M(lrwxrwxrwx) %y(l)
+%p(links/symlink) %d(1) %f(symlink) %h(links) %H(links) %P(symlink) %m(777) %M(lrwxrwxrwx) %y(l)
+%p(basic/c/d) %d(2) %f(d) %h(basic/c) %H(basic) %P(c/d) %m(644) %M(-rw-r--r--) %y(f)
+%p(basic/e/f) %d(2) %f(f) %h(basic/e) %H(basic) %P(e/f) %m(644) %M(-rw-r--r--) %y(f)
+%p(basic/g/h) %d(2) %f(h) %h(basic/g) %H(basic) %P(g/h) %m(755) %M(drwxr-xr-x) %y(d)
+%p(basic/j/foo) %d(2) %f(foo) %h(basic/j) %H(basic) %P(j/foo) %m(644) %M(-rw-r--r--) %y(f)
+%p(basic/k/foo) %d(2) %f(foo) %h(basic/k) %H(basic) %P(k/foo) %m(755) %M(drwxr-xr-x) %y(d)
+%p(basic/l/foo) %d(2) %f(foo) %h(basic/l) %H(basic) %P(l/foo) %m(755) %M(drwxr-xr-x) %y(d)
+%p(links/deeply/nested) %d(2) %f(nested) %h(links/deeply) %H(links) %P(deeply/nested) %m(755) %M(drwxr-xr-x) %y(d)
+%p(basic/k/foo/bar) %d(3) %f(bar) %h(basic/k/foo) %H(basic) %P(k/foo/bar) %m(644) %M(-rw-r--r--) %y(f)
+%p(basic/l/foo/bar) %d(3) %f(bar) %h(basic/l/foo) %H(basic) %P(l/foo/bar) %m(755) %M(drwxr-xr-x) %y(d)
+%p(links/deeply/nested/dir) %d(3) %f(dir) %h(links/deeply/nested) %H(links) %P(deeply/nested/dir) %m(755) %M(drwxr-xr-x) %y(d)
+%p(links/deeply/nested/file) %d(3) %f(file) %h(links/deeply/nested) %H(links) %P(deeply/nested/file) %m(644) %M(-rw-r--r--) %y(f)
+%p(links/deeply/nested/link) %d(3) %f(link) %h(links/deeply/nested) %H(links) %P(deeply/nested/link) %m(777) %M(lrwxrwxrwx) %y(l)
+%p(basic/l/foo/bar/baz) %d(4) %f(baz) %h(basic/l/foo/bar) %H(basic) %P(l/foo/bar/baz) %m(644) %M(-rw-r--r--) %y(f)