From eeac1ca41d9ad802ab911abcb17fc3f931f7a3bd Mon Sep 17 00:00:00 2001 From: Bastian Dehn Date: Fri, 25 Sep 2026 12:29:29 +0200 Subject: [PATCH] add test lib could not load --- src/albentohandy | 3 +++ tests/albentohandy.bats | 16 ++++++++++++++++ 2 files changed, 19 insertions(+) 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 -- 2.47.3