From: Bastian Dehn Date: Fri, 25 Sep 2026 10:59:25 +0000 (+0200) Subject: add test encode failed X-Git-Tag: v1.0.0^2~7^2~17 X-Git-Url: https://gitweb.hhaalo.de/?a=commitdiff_plain;h=664239f7a88c32ced417eb600cc2e01fd7435043;p=albentohandy.git add test encode failed --- diff --git a/src/albentohandy b/src/albentohandy index 5f96cc2..f76219e 100755 --- a/src/albentohandy +++ b/src/albentohandy @@ -100,7 +100,9 @@ main() mkdir --parents "$OUTPUT_PATH" || return $? make_symlinks_to_work "$albumlist" || return $? - encode "$OUTPUT_PATH" + encode "$OUTPUT_PATH" \ + || errlog "could not encode $OUTPUT_PATH" \ + || return $? } [ "$TEST_MODE" == "ON" ] && return 0 diff --git a/tests/albentohandy.bats b/tests/albentohandy.bats index 1967144..9f44ed9 100755 --- a/tests/albentohandy.bats +++ b/tests/albentohandy.bats @@ -215,4 +215,15 @@ teardown() { assert_success assert_equal "$(awk 'NR==1 {print; exit}' "$ENCODE_LOG")" "1" assert_equal "$(awk 'NR==2 {print; exit}' "$ENCODE_LOG")" "build/tests/output" +} + +@test "failed: could not encode" { + encode() { + return 1 + } + + run main -i "build/tests/albumlist" + + assert_failure + assert_line --index 0 "❌ ERROR: could not encode build/tests/output" } \ No newline at end of file