summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2022-06-01 15:58:59 -0400
committerTavian Barnes <tavianator@tavianator.com>2022-06-01 15:58:59 -0400
commit33293e337ed4d9205b1185c44e1fe3fcb1a10af6 (patch)
tree60e8fad61493fc667aa38eb9d60ce275f8018b8c
parent9f37797e68febd9f35715f85fcee146366b81ca8 (diff)
downloadbfs-33293e337ed4d9205b1185c44e1fe3fcb1a10af6.tar.xz
tests: Add a test for every printf directive
-rwxr-xr-xtests/tests.sh13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/tests.sh b/tests/tests.sh
index 04a6e0e..ff28438 100755
--- a/tests/tests.sh
+++ b/tests/tests.sh
@@ -847,6 +847,7 @@ bfs_tests=(
test_printf_duplicate_flag
test_printf_must_be_numeric
test_printf_color
+ test_printf_everything
test_type_multi
@@ -2490,6 +2491,18 @@ function test_printf_color() {
bfs_diff -color -path './rainbow*' -printf '%H %h %f %p %P %l\n'
}
+function test_printf_everything() {
+ local everything=(%{a,b,c,d,D,f,F,g,G,h,H,i,k,l,m,M,n,p,P,s,S,t,u,U,y,Y})
+ everything+=(%{A,C,T}{%,+,@,a,A,b,B,c,C,d,D,e,F,g,G,h,H,I,j,k,l,m,M,n,p,r,R,s,S,t,T,u,U,V,w,W,x,X,y,Y,z,Z})
+
+ # Check if we have birth times
+ if ! fail invoke_bfs basic -printf '%w' -quit >/dev/null; then
+ everything+=(%w %{B,W}{%,+,@,a,A,b,B,c,C,d,D,e,F,g,G,h,H,I,j,k,l,m,M,n,p,r,R,s,S,t,T,u,U,V,w,W,x,X,y,Y,z,Z})
+ fi
+
+ invoke_bfs rainbow -printf "${everything[*]}\n" >/dev/null
+}
+
function test_fprintf() {
invoke_bfs basic -fprintf scratch/test_fprintf.out '%%p(%p) %%d(%d) %%f(%f) %%h(%h) %%H(%H) %%P(%P) %%m(%m) %%M(%M) %%y(%y)\n'
sort -o scratch/test_fprintf.out scratch/test_fprintf.out