]> gitweb.hhaalo.de Git - albentohandy.git/commitdiff
add test create symlink error
authorBastian Dehn <hhaalo@arcor.de>
Fri, 25 Sep 2026 09:54:16 +0000 (11:54 +0200)
committerBastian Dehn <hhaalo@arcor.de>
Fri, 25 Sep 2026 09:54:16 +0000 (11:54 +0200)
src/albentohandy
tests/albentohandy.bats

index 21848f01e774be532956b4fcc19ad386ac32af62..e9bd782d283e02708e543f5c10f82d33d75a30f8 100755 (executable)
@@ -53,7 +53,9 @@ make_symlinks_to_work()
                cp --recursive \
                        --symbolic-link \
                        "$MUSIC_PATH/$album" \
-                       "$OUTPUT_PATH"
+                       "$OUTPUT_PATH" \
+                       || errlog "could not create symlinks for $album" \
+                       || return $?
        done
 }
 
index 32ec11af9b494d611d342361237d91ed42151a5e..88a6d69cc8d13350279f6a7a96652d72d722568b 100755 (executable)
@@ -142,4 +142,18 @@ teardown() {
 
        assert_success
        [ -h "build/tests/output/Artist1/file.flac" ]
+}
+
+@test "failed: create symlink for Alben/Artist1/file.flac" {
+       mkdir --parents "build/tests/output"
+       mkdir --parents "build/tests/music/Alben/Artist1"
+       echo "testfile" > "build/tests/music/Alben/Artist1/file.flac"
+       cp() {
+               return 1
+       }
+
+       run main -i "build/tests/albumlist"
+
+       assert_failure
+       assert_line --index 0 "❌ ERROR: could not create symlinks for Alben/Artist1"
 }
\ No newline at end of file