summaryrefslogtreecommitdiffstats
path: root/tests.sh
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2017-01-14 16:38:08 -0500
committerTavian Barnes <tavianator@tavianator.com>2017-02-05 19:02:25 -0500
commita6f94c132c425bbab543e98fcd19f4ff7519d1b7 (patch)
tree215135837c0335946b70593877ec5411ba8e6c17 /tests.sh
parent9f1863d45fe596e258596a4b4cc9a4064bcb11d3 (diff)
downloadbfs-a6f94c132c425bbab543e98fcd19f4ff7519d1b7.tar.xz
Implement -printf/-fprintf
Based on a patch by Fangrui Song <i@maskray.me>. Closes #16.
Diffstat (limited to 'tests.sh')
-rwxr-xr-xtests.sh51
1 files changed, 42 insertions, 9 deletions
diff --git a/tests.sh b/tests.sh
index 5a7e650..7e85cff 100755
--- a/tests.sh
+++ b/tests.sh
@@ -145,7 +145,7 @@ for arg; do
done
function bfs_sort() {
- awk -F/ '{ print NF - 1 " " $0 }' | sort -n | awk '{ print $2 }'
+ awk -F/ '{ print NF - 1 " " $0 }' | sort -n | cut -d' ' -f2-
}
function bfs_diff() {
@@ -787,13 +787,6 @@ function test_0127() {
bfs_diff basic -inum "$inode"
}
-function test_0127() {
- [ "$BSD" -o "$GNU" ] || return 0
-
- local inode="$(ls -id basic/k/foo/bar | cut -f1 -d' ')"
- bfs_diff basic -inum "$inode"
-}
-
function test_0128() {
[ "$BSD" -o "$GNU" ] || return 0
bfs_diff basic -nogroup
@@ -804,9 +797,49 @@ function test_0129() {
bfs_diff basic -nouser
}
+function test_0130() {
+ [ "$GNU" ] || return 0
+ bfs_diff basic -printf '%%p(%p) %%d(%d) %%f(%f) %%h(%h) %%H(%H) %%P(%P) %%m(%m) %%M(%M) %%y(%y)\n'
+}
+
+function test_0131() {
+ [ "$GNU" ] || return 0
+ bfs_diff / -maxdepth 0 -printf '(%h)/(%f)\n'
+}
+
+function test_0132() {
+ [ "$GNU" ] || return 0
+ bfs_diff /// -maxdepth 0 -printf '(%h)/(%f)\n'
+}
+
+function test_0133() {
+ [ "$GNU" ] || return 0
+ bfs_diff basic/ -printf '(%h)/(%f)\n'
+}
+
+function test_0134() {
+ [ "$GNU" ] || return 0
+ bfs_diff basic/// -printf '(%h)/(%f)\n'
+}
+
+function test_0135() {
+ [ "$GNU" ] || return 0
+ bfs_diff basic -printf '|%- 10.10p| %+03d %#4m\n'
+}
+
+function test_0136() {
+ [ "$GNU" ] || return 0
+ bfs_diff links -printf '(%p) (%l) %y %Y\n'
+}
+
+function test_0137() {
+ [ "$GNU" ] || return 0
+ bfs_diff basic -maxdepth 0 -printf '\18\118\1118\11118\n\cfoo'
+}
+
result=0
-for i in {1..129}; do
+for i in {1..137}; do
test="test_$(printf '%04d' $i)"
if [ -t 1 ]; then