From: Bastian Dehn Date: Fri, 25 Sep 2026 08:12:03 +0000 (+0200) Subject: add tests for other libs failed by missing X-Git-Tag: v1.0.0^2~7^2~31 X-Git-Url: https://gitweb.hhaalo.de/?a=commitdiff_plain;h=0cae5d601a8584389637ece1fa19f5b8e02b6e02;p=albentohandy.git add tests for other libs failed by missing --- diff --git a/src/albentohandy b/src/albentohandy index 25e366e..9bfbfb8 100755 --- a/src/albentohandy +++ b/src/albentohandy @@ -36,6 +36,15 @@ main() check_programs || return $? load_config || return $? + while getopts "3fo" opt; do + case "$opt" in + "3") lib="mp3.sh" ;; + "f") lib="flac.sh" ;; + "o") lib="opus.sh" ;; + *) errlog "unknown option" && return 1 ;; + esac + done + [ -f "$LIB_PATH/$lib" ] \ || errlog "lib $LIB_PATH/$lib not found" \ || return $? diff --git a/tests/albentohandy.bats b/tests/albentohandy.bats index ebead4d..091dbbe 100755 --- a/tests/albentohandy.bats +++ b/tests/albentohandy.bats @@ -49,4 +49,32 @@ teardown() { assert_failure assert_line --index 0 "❌ ERROR: lib src/lib/vorbis.sh not found" +} + +@test "failed: lib mp3.sh not found" { + run main -3 + + assert_failure + assert_line --index 0 "❌ ERROR: lib src/lib/mp3.sh not found" +} + +@test "failed: lib flac.sh not found" { + run main -f + + assert_failure + assert_line --index 0 "❌ ERROR: lib src/lib/flac.sh not found" +} + +@test "failed: lib opus.sh not found" { + run main -o + + assert_failure + assert_line --index 0 "❌ ERROR: lib src/lib/opus.sh not found" +} + +@test "failed: unknown option" { + run main -x + + assert_failure + assert_line --index 1 "❌ ERROR: unknown option" } \ No newline at end of file