|| errlog "missing output" \
|| return $?
- local output_pdf=
- local tiff=
- for tiff in scanned-$$-*.tiff; do
- output_pdf=${tiff/.tiff/.pdf}
- tiff2pdf $tiff -o $output_pdf \
- || errlog "could not convert tiff to pdf" \
- || return $?
- rm $tiff \
- || errlog "could not delete $tiff" \
- || return $?
- done
+ export -f convert_tiff_to_pdf
+ find scanned-$$-*.tiff \
+ | sort \
+ | parallel convert_tiff_to_pdf {}
pdftk scanned-$$-*.pdf output $output \
|| errlog "could not convert into single $output" \
assert_line --index 0 "❌ ERROR: missing output"
}
-@test "should failure createonepdf tiff2pdf fails" {
- tiff2pdf() {
- return 1
- }
-
- run createonepdf "testfile"
-
- assert_failure
- assert_line --index 0 "❌ ERROR: could not convert tiff to pdf"
-}
-
@test "should failure createonepdf pdftk fails" {
tiff2pdf() {
:
rm() {
:
}
+ find() {
+ :
+ }
pdftk() {
return 1
}