test: derive expected agent and skill counts from source (Bash)

Bash equivalent of the PowerShell test change. Also relaxes the platform
dry-run assertion to match on "-$platform" instead of "-$platform/", since
the installer now reports one destination summary line per sync instead of
one line per copied file.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
Julian lechner
2026-09-11 15:42:41 +02:00
co-authored by Claude Sonnet 5
parent b1d5a7be42
commit 83b260533a
+8 -3
View File
@@ -7,14 +7,19 @@ grep -Eq '\$FadeMs[[:space:]]*=[[:space:]]*250' "$root/shared/hooks/flashbang.ps
branch=$(git -C "$root" branch --show-current) branch=$(git -C "$root" branch --show-current)
status_output=$(printf '{"model":{"display_name":"Test Model"},"effort":{"level":"high"},"workspace":{"current_dir":"%s","repo":{"name":"TestRepo"}},"context_window":{"context_window_size":200000,"used_percentage":8.5,"total_input_tokens":15500,"total_output_tokens":1200}}' "$root" | bash "$root/shared/statusline/statusline.sh") status_output=$(printf '{"model":{"display_name":"Test Model"},"effort":{"level":"high"},"workspace":{"current_dir":"%s","repo":{"name":"TestRepo"}},"context_window":{"context_window_size":200000,"used_percentage":8.5,"total_input_tokens":15500,"total_output_tokens":1200}}' "$root" | bash "$root/shared/statusline/statusline.sh")
[ "$status_output" = "Model: Test Model | Effort: high | Repo: TestRepo | Branch: $branch | Max Context: 200000 | Used Context: 9% | Used Tokens: 16700" ] [ "$status_output" = "Model: Test Model | Effort: high | Repo: TestRepo | Branch: $branch | Max Context: 200000 | Used Context: 9% | Used Tokens: 16700" ]
source_agent_count=$(find "$root/shared/agents" -mindepth 1 -maxdepth 1 -type d | wc -l)
source_skill_count=$(find "$root/shared/skills" -name SKILL.md | wc -l)
rule_skill_count=$(($(wc -l < "$root/adapters/claude/rule-skills.tsv") - 1))
for platform in windows linux; do for platform in windows linux; do
for client in codex claude; do for client in codex claude; do
package="$root/generated/$client-$platform" package="$root/generated/$client-$platform"
file=config.toml file=config.toml
[ "$client" != claude ] || file=settings.json [ "$client" != claude ] || file=settings.json
test -f "$package/$file" test -f "$package/$file"
test "$(find "$package/agents" -type f | wc -l)" -eq 5 test "$(find "$package/agents" -type f | wc -l)" -eq "$source_agent_count"
test "$(find "$package/skills" -name SKILL.md | wc -l)" -eq 22 expected_skill_count=$source_skill_count
[ "$client" != claude ] || expected_skill_count=$((source_skill_count + rule_skill_count))
test "$(find "$package/skills" -name SKILL.md | wc -l)" -eq "$expected_skill_count"
if [ "$platform" = windows ]; then if [ "$platform" = windows ]; then
grep -q 'powershell .*flashbang.ps1' "$package/$file" grep -q 'powershell .*flashbang.ps1' "$package/$file"
! grep -Eq 'WindowStyle[[:space:]]+Hidden' "$package/$file" ! grep -Eq 'WindowStyle[[:space:]]+Hidden' "$package/$file"
@@ -46,7 +51,7 @@ for platform_selection in 1 2; do
[[ "$output" == *'PASS install dry-run'* ]] [[ "$output" == *'PASS install dry-run'* ]]
platform=windows platform=windows
[ "$platform_selection" != 2 ] || platform=linux [ "$platform_selection" != 2 ] || platform=linux
[[ "$output" == *"-$platform/"* ]] [[ "$output" == *"-$platform"* ]]
done done
done done
printf 'PASS four platform packages and six Bash selections\n' printf 'PASS four platform packages and six Bash selections\n'