From f1d209d939b21ffc031001a9fddd37466e12fc8d Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Fri, 1 Oct 2021 10:37:57 -0400 Subject: tests: Add a tests for missing and nonexistent paths --- tests.sh | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/tests.sh b/tests.sh index 01ff9c0..bfbbf9d 100755 --- a/tests.sh +++ b/tests.sh @@ -518,11 +518,15 @@ gnu_tests=( test_fprint test_fprint_duplicate test_fprint_error + test_fprint_noarg + test_fprint_nonexistent test_fprint_truncate test_fprint0 test_fprintf + test_fprintf_nofile + test_fprintf_noformat test_fstype @@ -1727,6 +1731,14 @@ function test_fprint_duplicate_stdout() { fi } +function test_fprint_noarg() { + ! quiet invoke_bfs basic -fprint +} + +function test_fprint_nonexistent() { + ! quiet invoke_bfs basic -fprint scratch/nonexistent/path +} + function test_fprint_truncate() { printf "basic\nbasic\n" >scratch/test_fprint_truncate.out @@ -2281,6 +2293,14 @@ function test_fprintf() { fi } +function test_fprintf_nofile() { + ! quiet invoke_bfs basic -fprintf +} + +function test_fprintf_noformat() { + ! quiet invoke_bfs basic -fprintf /dev/null +} + function test_fstype() { fstype="$(invoke_bfs basic -maxdepth 0 -printf '%F\n')" bfs_diff basic -fstype "$fstype" -- cgit v1.2.3