File tree Expand file tree Collapse file tree 2 files changed +35
-1
lines changed
Expand file tree Collapse file tree 2 files changed +35
-1
lines changed Original file line number Diff line number Diff line change 2727 echo " sdkmanager --install \" cmdline-tools;latest\" "
2828 echo " Once installed, ensure the cmdline-tools are located at: $ANDROID_HOME /cmdline-tools/latest/bin"
2929 fi
30- fi
30+ fi
Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bats
2+ # tests/test_plugin_android_sdk.bats - Verify android-sdk plugin init behavior
3+
4+ load helpers
5+
6+ setup () {
7+ export TEST_TEMP_DIR=$( mktemp -d)
8+ export HOME=" $TEST_TEMP_DIR /home"
9+ mkdir -p " $HOME "
10+ # Ensure OSA_REPO_PATH is available to helpers
11+ export OSA_REPO_PATH=" $OSA_TEST_REPO_ROOT "
12+ }
13+
14+ teardown () {
15+ rm -rf " $TEST_TEMP_DIR "
16+ }
17+
18+ @test " android-sdk plugin informs user when Android SDK cmdline-tools missing" {
19+ run bash -c " . '$OSA_TEST_REPO_ROOT /src/zsh/plugin-init/android-sdk.zsh'"
20+ # The plugin should not error; it should print an informative message about missing cmdline-tools
21+ [[ " $status " -eq 0 ]]
22+ [[ " $output " =~ " Android cmdline-tools not found" ]] || [[ " $output " =~ " Available cmdline-tools directories" ]]
23+ }
24+
25+ @test " android-sdk plugin suggests symlink when cmdline-tools present but 'latest' missing" {
26+ # Create a fake cmdline-tools/version directory but not 'latest'
27+ mkdir -p " $HOME /Library/Android/sdk/cmdline-tools/5.0"
28+
29+ run bash -c " . '$OSA_TEST_REPO_ROOT /src/zsh/plugin-init/android-sdk.zsh'"
30+ [[ " $status " -eq 0 ]]
31+ # Should list available cmdline-tools directories and suggest creating a 'latest' symlink
32+ [[ " $output " =~ " Available cmdline-tools directories" ]]
33+ [[ " $output " =~ " create a 'latest' symlink" ]] || [[ " $output " =~ " ln -s" ]]
34+ }
You can’t perform that action at this time.
0 commit comments