]> gitweb.hhaalo.de Git - albentohandy.git/commitdiff
add tests for other libs failed by missing
authorBastian Dehn <hhaalo@arcor.de>
Fri, 25 Sep 2026 08:12:03 +0000 (10:12 +0200)
committerBastian Dehn <hhaalo@arcor.de>
Fri, 25 Sep 2026 08:12:03 +0000 (10:12 +0200)
src/albentohandy
tests/albentohandy.bats

index 25e366e01039550789cc9cb1fd74c64f058fba93..9bfbfb89762cfedab1487b2c55a427b29082a999 100755 (executable)
@@ -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 $?
index ebead4d6287963dd45396ea2e8ddd5278d2b87c7..091dbbe3fe9215191775c2f6fc42c702adeb7823 100755 (executable)
@@ -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