From: Bastian Dehn Date: Fri, 25 Sep 2026 10:29:29 +0000 (+0200) Subject: add test lib could not load X-Git-Tag: v1.0.0^2~7^2~19 X-Git-Url: https://gitweb.hhaalo.de/?a=commitdiff_plain;h=eeac1ca41d9ad802ab911abcb17fc3f931f7a3bd;p=albentohandy.git add test lib could not load --- diff --git a/src/albentohandy b/src/albentohandy index 2949a70..1d64b0e 100755 --- a/src/albentohandy +++ b/src/albentohandy @@ -90,6 +90,9 @@ main() [ -f "$LIB_PATH/$lib" ] \ || errlog "lib $LIB_PATH/$lib not found" \ || return $? + source "$LIB_PATH/$lib" \ + || errlog "could not load library $LIB_PATH/$lib" \ + || return $? [ -f "$albumlist" ] \ || errlog "file $albumlist does not exists" \ diff --git a/tests/albentohandy.bats b/tests/albentohandy.bats index 4adf702..7251d53 100755 --- a/tests/albentohandy.bats +++ b/tests/albentohandy.bats @@ -104,6 +104,22 @@ teardown() { assert_line --index 1 "❌ ERROR: unknown option" } +@test "failed: could not load library" { + MUSIC_PATH="build/tests/music" + OUTPUT_PATH="build/tests/output" + load_config() { + : + } + source() { + return 1 + } + + run main -i "build/tests/albumlist" + + assert_failure + assert_line --index 0 "❌ ERROR: could not load library src/lib/vorbis.sh" +} + @test "failed: albumlist not found" { run main