set test "Exit status is 0 when something is found" clear_pdfdir set pdf [mkpdf exit-status "foobar"] pdfgrep foobar $pdf expect eof expect_exit_status 0 ######################################## set test "Exit status is 0 when something is found, also with --quiet" pdfgrep --quiet foobar $pdf expect eof expect_exit_status 0 ######################################## set test "Exit status is 1 when nothing is found" pdfgrep not-there $pdf expect eof expect_exit_status 1 ######################################## set test "Exit status is 2 on error" clear_pdfdir # $pdf doesn't exist anymore pdfgrep foobar $pdf expect eof expect_exit_status 2