From 120fa2da55f3ab5d58c2ff4b320329e9fe5d982e Mon Sep 17 00:00:00 2001 From: Bastian Dehn Date: Fri, 25 Sep 2026 16:48:20 +0200 Subject: [PATCH] add flac check work path --- src/lib/flac.sh | 9 +++++++++ tests/flac.bats | 10 +++++++++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/src/lib/flac.sh b/src/lib/flac.sh index c0fdd80..308f358 100644 --- a/src/lib/flac.sh +++ b/src/lib/flac.sh @@ -16,4 +16,13 @@ flac_check_programs() || return $? } +flac_encode() +{ + local work_path="$1" + + [ -n "$work_path" ] \ + || flac_errlog "missing work path" \ + || return $? +} + flac_check_programs || return $? \ No newline at end of file diff --git a/tests/flac.bats b/tests/flac.bats index a86e0bc..d5a03b6 100755 --- a/tests/flac.bats +++ b/tests/flac.bats @@ -6,7 +6,7 @@ setup() { source "src/lib/flac.sh" } -# bats test_tag=flac:check_programs +# bats test_tags=flac:check_programs @test "failed: check programs missing metaflac" { command() { [ "$2" != "metaflac" ] || return 1 @@ -16,4 +16,12 @@ setup() { assert_failure assert_line --index 0 "❌ ERROR: command metaflac not found" +} + +# bats test_tags=flac:params +@test "failed: mising work path" { + run flac_encode + + assert_failure + assert_line --index 0 "❌ ERROR: missing work path" } \ No newline at end of file -- 2.47.3