mirror of
https://github.com/httprunner/httprunner.git
synced 2026-07-12 16:01:27 +08:00
optimize FindTexts return
This commit is contained in:
@@ -163,16 +163,16 @@ func (t OCRTexts) FindTexts(texts []string, options ...ActionOption) (results OC
|
|||||||
results = append(results, ocrText)
|
results = append(results, ocrText)
|
||||||
}
|
}
|
||||||
|
|
||||||
if actionOptions.MatchOne && len(results) == 0 {
|
if len(results) == len(texts) {
|
||||||
return nil, errors.Wrap(code.CVResultNotFoundError,
|
return results, nil
|
||||||
fmt.Sprintf("texts %s not found in %v", texts, t.texts()))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if !actionOptions.MatchOne && len(results) != len(texts) {
|
if actionOptions.MatchOne && len(results) > 0 {
|
||||||
return nil, errors.Wrap(code.CVResultNotFoundError,
|
return results, nil
|
||||||
fmt.Sprintf("texts %s not found in %v", texts, t.texts()))
|
|
||||||
}
|
}
|
||||||
return results, nil
|
|
||||||
|
return nil, errors.Wrap(code.CVResultNotFoundError,
|
||||||
|
fmt.Sprintf("texts %s not found in %v", texts, t.texts()))
|
||||||
}
|
}
|
||||||
|
|
||||||
func newVEDEMImageService() (*veDEMImageService, error) {
|
func newVEDEMImageService() (*veDEMImageService, error) {
|
||||||
|
|||||||
Reference in New Issue
Block a user