summaryrefslogtreecommitdiff
path: root/testsuite/pdfgrep.tests/patternlist.exp
blob: e9168f3778367e8e59ed0b932adeba439ad674ea (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
# These are tests for --regex and --file

set test "-e"

clear_pdfdir
set pdf [mkpdf pdf {
    line1\\
    line2\\
    -a dash
}]

pdfgrep_expect -e line $pdf \
"line1
line2"

######################################################################

set test "-e multiple times"

pdfgrep_expect --regexp 1 -e 2 $pdf \
"line1
line2"

######################################################################

set test "-e argument with a dash"

# See poppler bug 91644
# https://bugs.freedesktop.org/show_bug.cgi?id=91644
set required_poppler_version {0 36 0}

pdfgrep_expect -e -a $pdf \
"-a dash"

######################################################################

set test "--file"

set filename "$pdfdir/patternfile"
set fileId [open "$filename" "w"]
puts $fileId "1"
puts $fileId "2"
close $fileId

pdfgrep_expect --file "$filename" $pdf \
"line1
line2"

######################################################################

set test "--file used twice"

# See poppler bug 91644
# https://bugs.freedesktop.org/show_bug.cgi?id=91644
set required_poppler_version {0 36 0}

set filename2 "$pdfdir/patternfile2"
set fileId [open "$filename2" "w"]
puts $fileId "dash"
close $fileId

pdfgrep_expect -f "$filename" --file "$filename2" $pdf \
"line1
line2
-a dash"

######################################################################

set test "--file and --regexp"

# See poppler bug 91644
# https://bugs.freedesktop.org/show_bug.cgi?id=91644
set required_poppler_version {0 36 0}

pdfgrep_expect --file "$filename" --regexp "dash" $pdf \
"line1
line2
-a dash"