From 33293e337ed4d9205b1185c44e1fe3fcb1a10af6 Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Wed, 1 Jun 2022 15:58:59 -0400 Subject: tests: Add a test for every printf directive --- tests/tests.sh | 13 +++++++++++++ 1 file changed, 13 insertions(+) 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 -- cgit v1.2.3