Skip to content

test: add test for parameter expansion with command substitution ${VAR:-$(cmd)} - #2695

Merged
chaliy merged 1 commit into
mainfrom
fix/bashkit-var-expansion-default
Oct 12, 2026
Merged

chaliy merged 1 commit into
mainfrom
fix/bashkit-var-expansion-default

Conversation

@chaliy

@chaliy chaliy commented Oct 12, 2026

Copy link
Copy Markdown
Contributor

This PR adds a comprehensive test for the parameter expansion behavior with command substitution in default values.

Test Coverage

  • Unset variable: ${VAR:-$(echo hello)} runs command substitution
  • Empty variable: ${VAR:-$(echo hello)} runs command substitution (:- means unset OR empty)
  • Set variable: ${VAR:-$(echo hello)} does NOT run command substitution
  • Without colon: ${VAR-$(echo hello)} only runs for unset, not empty

The implementation already correctly handles these cases, matching bash behavior exactly.

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
bashkit f0a5ee8 Commit Preview URL

Branch Preview URL
Oct 12 2026, 01:31 AM

@chaliy
chaliy merged commit bde9358 into main Oct 12, 2026
33 checks passed
@chaliy
chaliy deleted the fix/bashkit-var-expansion-default branch October 12, 2026 01:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant