]> gitweb.hhaalo.de Git - albentohandy.git/commitdiff
add test lib could not load
authorBastian Dehn <hhaalo@arcor.de>
Fri, 25 Sep 2026 10:29:29 +0000 (12:29 +0200)
committerBastian Dehn <hhaalo@arcor.de>
Fri, 25 Sep 2026 10:29:29 +0000 (12:29 +0200)
src/albentohandy
tests/albentohandy.bats

index 2949a7060de46b3875a2ee65deee2eab823c3704..1d64b0e9ab7c3db51d08fbef9c38dbb68522cbeb 100755 (executable)
@@ -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" \
index 4adf7027c54a87b1720053892ac7ab62420bfa57..7251d539db68c32882e53c97dda7684cf65eb85f 100755 (executable)
@@ -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