From 47ce6b0c50c9012ba9831de6c9d52c10a10b39ee Mon Sep 17 00:00:00 2001 From: tw93 Date: Fri, 30 Jan 2026 11:06:54 +0800 Subject: [PATCH] Fix the issue with automated testing --- tests/dev_extended.bats | 8 ++++---- tests/uninstall_naming_variants.bats | 10 +++++----- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/tests/dev_extended.bats b/tests/dev_extended.bats index f7a66ec..d6c19fd 100644 --- a/tests/dev_extended.bats +++ b/tests/dev_extended.bats @@ -123,28 +123,28 @@ EOF } @test "check_android_ndk reports multiple NDK versions" { - run bash -c 'HOME=$(mktemp -d) && mkdir -p "$HOME/Library/Android/sdk/ndk"/{21.0.1,22.0.0,20.0.0} && source "$0" && note_activity() { :; } && NC="" && GREEN="" && GRAY="" && YELLOW="" && ICON_WARNING="●" && check_android_ndk' "$PROJECT_ROOT/lib/clean/dev.sh" + run bash -c 'HOME=$(mktemp -d) && mkdir -p "$HOME/Library/Android/sdk/ndk"/{21.0.1,22.0.0,20.0.0} && source "$0" && note_activity() { :; } && NC="" && GREEN="" && GRAY="" && YELLOW="" && ICON_SUCCESS="✓" && check_android_ndk' "$PROJECT_ROOT/lib/clean/dev.sh" [ "$status" -eq 0 ] [[ "$output" == *"Android NDK versions: 3 found"* ]] } @test "check_android_ndk silent when only one NDK" { - run bash -c 'HOME=$(mktemp -d) && mkdir -p "$HOME/Library/Android/sdk/ndk/22.0.0" && source "$0" && note_activity() { :; } && NC="" && GREEN="" && GRAY="" && YELLOW="" && ICON_WARNING="●" && check_android_ndk' "$PROJECT_ROOT/lib/clean/dev.sh" + run bash -c 'HOME=$(mktemp -d) && mkdir -p "$HOME/Library/Android/sdk/ndk/22.0.0" && source "$0" && note_activity() { :; } && NC="" && GREEN="" && GRAY="" && YELLOW="" && ICON_SUCCESS="✓" && check_android_ndk' "$PROJECT_ROOT/lib/clean/dev.sh" [ "$status" -eq 0 ] [[ "$output" != *"NDK versions"* ]] } @test "check_rust_toolchains reports multiple toolchains" { - run bash -c 'HOME=$(mktemp -d) && mkdir -p "$HOME/.rustup/toolchains"/{stable,nightly,1.75.0}-aarch64-apple-darwin && source "$0" && note_activity() { :; } && NC="" && GREEN="" && GRAY="" && YELLOW="" && ICON_WARNING="●" && rustup() { :; } && export -f rustup && check_rust_toolchains' "$PROJECT_ROOT/lib/clean/dev.sh" + run bash -c 'HOME=$(mktemp -d) && mkdir -p "$HOME/.rustup/toolchains"/{stable,nightly,1.75.0}-aarch64-apple-darwin && source "$0" && note_activity() { :; } && NC="" && GREEN="" && GRAY="" && YELLOW="" && ICON_SUCCESS="✓" && rustup() { :; } && export -f rustup && check_rust_toolchains' "$PROJECT_ROOT/lib/clean/dev.sh" [ "$status" -eq 0 ] [[ "$output" == *"Rust toolchains: 3 found"* ]] } @test "check_rust_toolchains silent when only one toolchain" { - run bash -c 'HOME=$(mktemp -d) && mkdir -p "$HOME/.rustup/toolchains/stable-aarch64-apple-darwin" && source "$0" && note_activity() { :; } && NC="" && GREEN="" && GRAY="" && YELLOW="" && ICON_WARNING="●" && rustup() { :; } && export -f rustup && check_rust_toolchains' "$PROJECT_ROOT/lib/clean/dev.sh" + run bash -c 'HOME=$(mktemp -d) && mkdir -p "$HOME/.rustup/toolchains/stable-aarch64-apple-darwin" && source "$0" && note_activity() { :; } && NC="" && GREEN="" && GRAY="" && YELLOW="" && ICON_SUCCESS="✓" && rustup() { :; } && export -f rustup && check_rust_toolchains' "$PROJECT_ROOT/lib/clean/dev.sh" [ "$status" -eq 0 ] [[ "$output" != *"Rust toolchains"* ]] diff --git a/tests/uninstall_naming_variants.bats b/tests/uninstall_naming_variants.bats index 49b0ad2..efd687f 100644 --- a/tests/uninstall_naming_variants.bats +++ b/tests/uninstall_naming_variants.bats @@ -36,7 +36,7 @@ setup() { result=$(find_app_files "com.maestro.studio" "Maestro Studio") - [[ "$result" =~ ".config/maestro-studio" ]] + [[ "$result" =~ .config/maestro-studio ]] } @test "find_app_files detects no-space variant (MaestroStudio)" { @@ -56,7 +56,7 @@ setup() { result=$(find_app_files "dev.zed.Zed-Nightly" "Zed Nightly") - [[ "$result" =~ ".config/zed" ]] + [[ "$result" =~ .config/zed ]] [[ "$result" =~ "Library/Application Support/Zed" ]] } @@ -73,10 +73,10 @@ setup() { result=$(find_app_files "com.maestro.studio" "Maestro Studio") - [[ "$result" =~ ".config/maestro-studio" ]] + [[ "$result" =~ .config/maestro-studio ]] [[ "$result" =~ "Library/Application Support/MaestroStudio" ]] [[ "$result" =~ "Library/Application Support/Maestro-Studio" ]] - [[ "$result" =~ ".local/share/maestrostudio" ]] + [[ "$result" =~ .local/share/maestrostudio ]] } @test "find_app_files handles multi-word version suffix (Firefox Developer Edition)" { @@ -85,7 +85,7 @@ setup() { result=$(find_app_files "org.mozilla.firefoxdeveloperedition" "Firefox Developer Edition") - [[ "$result" =~ ".local/share/firefox" ]] + [[ "$result" =~ .local/share/firefox ]] } @test "find_app_files does not match empty app name" {