Commit b2132b8
authored
fix(interpreter): expand command substitutions in assoc array keys (#883)
## Summary
- Associative array assignments where the key is a command substitution
(e.g. `m["$(echo hello)"]="world"`) silently produced an empty key
- Add async `expand_assoc_key()` that parses the subscript as a full
Word and expands it with `expand_word()` when it contains `$(` or
backtick
- Add spec test `assoc_key_command_substitution`
## Test plan
- [x] New spec test `assoc_key_command_substitution` passes
- [x] All 1811 bash spec tests pass (100%)
- [x] Full `cargo test --all-features` passes
- [x] `cargo fmt --check` clean
- [x] `cargo clippy -- -D warnings` clean
Closes #8721 parent a4e09c8 commit b2132b8
2 files changed
Lines changed: 19 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7714 | 7714 | | |
7715 | 7715 | | |
7716 | 7716 | | |
7717 | | - | |
7718 | | - | |
7719 | | - | |
| 7717 | + | |
| 7718 | + | |
7720 | 7719 | | |
7721 | | - | |
7722 | | - | |
| 7720 | + | |
| 7721 | + | |
| 7722 | + | |
| 7723 | + | |
| 7724 | + | |
| 7725 | + | |
7723 | 7726 | | |
7724 | 7727 | | |
7725 | | - | |
| 7728 | + | |
7726 | 7729 | | |
7727 | 7730 | | |
7728 | 7731 | | |
| |||
Lines changed: 10 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
202 | 202 | | |
203 | 203 | | |
204 | 204 | | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
205 | 215 | | |
206 | 216 | | |
207 | 217 | | |
| |||
0 commit comments