From: Bastian Dehn Date: Fri, 25 Sep 2026 09:54:16 +0000 (+0200) Subject: add test create symlink error X-Git-Tag: v1.0.0^2~7^2~22 X-Git-Url: https://gitweb.hhaalo.de/?a=commitdiff_plain;h=2bfb91a0e5e81397ab94eeab71e4506b81c98989;p=albentohandy.git add test create symlink error --- diff --git a/src/albentohandy b/src/albentohandy index 21848f0..e9bd782 100755 --- a/src/albentohandy +++ b/src/albentohandy @@ -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 } diff --git a/tests/albentohandy.bats b/tests/albentohandy.bats index 32ec11a..88a6d69 100755 --- a/tests/albentohandy.bats +++ b/tests/albentohandy.bats @@ -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