@@ -150,7 +150,7 @@ func TestImageOCRExtractor_Available(t *testing.T) {
150150
151151func TestDefaultExtractors_Order (t * testing.T ) {
152152 t .Parallel ()
153- extractors := DefaultExtractors (0 , 0 , true , 0 )
153+ extractors := DefaultExtractors (0 , 0 , true )
154154 require .Len (t , extractors , 4 )
155155 assert .Equal (t , "pdftotext" , extractors [0 ].Tool ())
156156 assert .Equal (t , "plaintext" , extractors [1 ].Tool ())
@@ -166,7 +166,7 @@ func TestDefaultExtractors_Order(t *testing.T) {
166166
167167func TestDefaultExtractors_Passthrough (t * testing.T ) {
168168 t .Parallel ()
169- extractors := DefaultExtractors (42 , 99 , true , 0 )
169+ extractors := DefaultExtractors (42 , 99 , true )
170170 pdfExt , ok := extractors [0 ].(* PDFTextExtractor )
171171 require .True (t , ok )
172172 assert .Equal (t , 99 , int (pdfExt .Timeout ))
@@ -178,50 +178,38 @@ func TestDefaultExtractors_Passthrough(t *testing.T) {
178178
179179func TestDefaultExtractors_OCRDisabled (t * testing.T ) {
180180 t .Parallel ()
181- extractors := DefaultExtractors (0 , 0 , false , 0 )
181+ extractors := DefaultExtractors (0 , 0 , false )
182182 require .Len (t , extractors , 2 )
183183 assert .Equal (t , "pdftotext" , extractors [0 ].Tool ())
184184 assert .Equal (t , "plaintext" , extractors [1 ].Tool ())
185185}
186186
187- func TestDefaultExtractors_ConfidencePassthrough (t * testing.T ) {
188- t .Parallel ()
189- extractors := DefaultExtractors (0 , 0 , true , 70 )
190- pdfOCR , ok := extractors [2 ].(* PDFOCRExtractor )
191- require .True (t , ok )
192- assert .Equal (t , 70 , pdfOCR .ConfidenceThreshold )
193-
194- imgOCR , ok := extractors [3 ].(* ImageOCRExtractor )
195- require .True (t , ok )
196- assert .Equal (t , 70 , imgOCR .ConfidenceThreshold )
197- }
198-
199187// --- HasMatchingExtractor ---
200188
201189func TestHasMatchingExtractor_Tesseract_PDF (t * testing.T ) {
202190 t .Parallel ()
203- extractors := DefaultExtractors (0 , 0 , true , 0 )
191+ extractors := DefaultExtractors (0 , 0 , true )
204192 got := HasMatchingExtractor (extractors , "tesseract" , "application/pdf" )
205193 assert .Equal (t , OCRAvailable (), got )
206194}
207195
208196func TestHasMatchingExtractor_Tesseract_Image (t * testing.T ) {
209197 t .Parallel ()
210- extractors := DefaultExtractors (0 , 0 , true , 0 )
198+ extractors := DefaultExtractors (0 , 0 , true )
211199 got := HasMatchingExtractor (extractors , "tesseract" , "image/png" )
212200 assert .Equal (t , ImageOCRAvailable (), got )
213201}
214202
215203func TestHasMatchingExtractor_Pdftotext (t * testing.T ) {
216204 t .Parallel ()
217- extractors := DefaultExtractors (0 , 0 , true , 0 )
205+ extractors := DefaultExtractors (0 , 0 , true )
218206 got := HasMatchingExtractor (extractors , "pdftotext" , "application/pdf" )
219207 assert .Equal (t , HasPDFToText (), got )
220208}
221209
222210func TestHasMatchingExtractor_NoMatch (t * testing.T ) {
223211 t .Parallel ()
224- extractors := DefaultExtractors (0 , 0 , true , 0 )
212+ extractors := DefaultExtractors (0 , 0 , true )
225213 assert .False (t , HasMatchingExtractor (extractors , "tesseract" , "text/plain" ))
226214 assert .False (t , HasMatchingExtractor (extractors , "pdftotext" , "image/png" ))
227215 assert .False (t , HasMatchingExtractor (extractors , "nonexistent" , "application/pdf" ))
@@ -231,21 +219,21 @@ func TestHasMatchingExtractor_NoMatch(t *testing.T) {
231219
232220func TestNeedsOCR_PDF (t * testing.T ) {
233221 t .Parallel ()
234- extractors := DefaultExtractors (0 , 0 , true , 0 )
222+ extractors := DefaultExtractors (0 , 0 , true )
235223 got := NeedsOCR (extractors , "application/pdf" )
236224 assert .Equal (t , OCRAvailable (), got )
237225}
238226
239227func TestNeedsOCR_Image (t * testing.T ) {
240228 t .Parallel ()
241- extractors := DefaultExtractors (0 , 0 , true , 0 )
229+ extractors := DefaultExtractors (0 , 0 , true )
242230 got := NeedsOCR (extractors , "image/png" )
243231 assert .Equal (t , ImageOCRAvailable (), got )
244232}
245233
246234func TestNeedsOCR_PlainText (t * testing.T ) {
247235 t .Parallel ()
248- extractors := DefaultExtractors (0 , 0 , true , 0 )
236+ extractors := DefaultExtractors (0 , 0 , true )
249237 assert .False (t , NeedsOCR (extractors , "text/plain" ))
250238}
251239
@@ -260,7 +248,7 @@ func TestNeedsOCR_NoOCRExtractors(t *testing.T) {
260248
261249func TestExtractorTimeout (t * testing.T ) {
262250 t .Parallel ()
263- extractors := DefaultExtractors (0 , 42 , true , 0 )
251+ extractors := DefaultExtractors (0 , 42 , true )
264252 assert .Equal (t , time .Duration (42 ), ExtractorTimeout (extractors ))
265253}
266254
@@ -272,7 +260,7 @@ func TestExtractorTimeout_NoPDFText(t *testing.T) {
272260
273261func TestExtractorMaxPages (t * testing.T ) {
274262 t .Parallel ()
275- extractors := DefaultExtractors (15 , 0 , true , 0 )
263+ extractors := DefaultExtractors (15 , 0 , true )
276264 assert .Equal (t , 15 , ExtractorMaxPages (extractors ))
277265}
278266
0 commit comments