set test "warn-empty" clear_pdfdir set pdf [mkpdf empty {\rule{1cm}{1cm}}] pdfgrep_expect_error --warn-empty "foo" $pdf expect_exit_status 1 ###################################################################### set test "hash as match-prefix-separator" clear_pdfdir set pdf [mkpdf foo {foobar}] pdfgrep_expect --match-prefix-separator=# -Hn foo $pdf \ "$pdf#1#foobar" ###################################################################### set test "--null" clear_pdfdir set pdf1 [mkpdf one {foobar}] set pdf2 [mkpdf two {barfoo}] set line1_prefix $pdf1 set line2_prefix $pdf2 append line1_prefix "\0" append line1_prefix 1 append line2_prefix "\0" append line2_prefix 1 pdfgrep_expect --null -Hn foo $pdf1 $pdf2 \ "$line1_prefix:foobar $line2_prefix:barfoo" ###################################################################### set test "only-matching" clear_pdfdir set pdf [mkpdf pdf {this is a long line}] pdfgrep_expect --only-matching long $pdf \ "long" ###################################################################### set test "without arguments and no -r" set savedir [pwd] cd $pdfdir pdfgrep_expect foo \ "Usage.*" expect_exit_status 2 ###################################################################### set test "without arguments and -r" pdfgrep_expect -r long \ "./pdf.pdf:this is a long line" ###################################################################### set test "without arguments and -R" pdfgrep_expect -R long \ "./pdf.pdf:this is a long line" cd $savedir ###################################################################### set test "text in MediaBox and not in CropBox" # a pdf can have multiple boundary boxes. By default, poppler-cpp uses the # CropBox which can be smaller as the guaranteed largest MediaBox. But pdfgrep # should also find text that's in in the MediaBox and not in the CropBox. clear_pdfdir set pdf [mkpdf pdf { \pdfpageattr{ % This is smaller than the default mediabox /CropBox [0 300 595.28 841.89] } test }] pdfgrep_expect ".*" $pdf \ "test" ###################################################################### set test "Invalid locale setting" clear_pdfdir set pdf [mkpdf pdf foo] set env(LC_ALL) "invalid" pdfgrep_expect_error "foo" $pdf expect_exit_status 0 set env(LC_ALL) "C"