Skip to content

Comments

feat: associative arrays, chown/kill builtins, array slicing tests#236

Merged
chaliy merged 3 commits intomainfrom
claude/bashkit-bash-compatibility-BsDKD
Feb 23, 2026
Merged

feat: associative arrays, chown/kill builtins, array slicing tests#236
chaliy merged 3 commits intomainfrom
claude/bashkit-bash-compatibility-BsDKD

Conversation

@chaliy
Copy link
Contributor

@chaliy chaliy commented Feb 23, 2026

Summary

  • Implement associative arrays (declare -A): key-value access, iteration with ${!m[@]}, ${#m[@]}, unset element, variable keys
  • Add chown builtin (no-op in VFS, validates file existence, -R flag)
  • Add kill builtin (no-op in VFS, -l lists signals)
  • Handle unset for array elements at interpreter level (both indexed and assoc)
  • Fix expand_word_to_fields to produce separate fields for assoc array @/* and ArrayIndices
  • Add 27 new tests: 12 assoc-arrays, 8 array-slicing, 7 chown-kill
  • Update specs: 95 builtins, 711 bash tests (705 pass, 6 skip)

Test plan

  • All 27 new tests pass
  • cargo test --all-features passes (all 14 test suites)
  • cargo clippy --all-targets --all-features -- -D warnings clean
  • cargo fmt --check clean
  • Bash comparison tests pass (no mismatches with real bash)

- Implement associative arrays (declare -A): key-value access,
  iteration with ${!m[@]}, ${#m[@]}, unset element, variable keys
- Add chown builtin (no-op in VFS, validates file existence, -R flag)
- Add kill builtin (no-op in VFS, -l lists signals)
- Handle unset for array elements at interpreter level
- Fix expand_word_to_fields for assoc array @/* and ArrayIndices
- Add 27 new tests: 12 assoc-arrays, 8 array-slicing, 7 chown-kill
- Update specs: 95 builtins, 711 bash tests (705 pass, 6 skip)

https://claude.ai/code/session_012rzB3FRw7yoQWCG1mxyW7J
- Add ASCII guard in parse_arithmetic_impl to prevent byte/char index mismatch
- Use char-based indexing in Substring expansion for correct multi-byte handling
- Add regression test for multi-byte chars in variable expansion
- Fixes proptest failure: "${:¡%}" caused byte boundary panic

https://claude.ai/code/session_012rzB3FRw7yoQWCG1mxyW7J
@chaliy chaliy merged commit a17d25a into main Feb 23, 2026
16 checks passed
@chaliy chaliy deleted the claude/bashkit-bash-compatibility-BsDKD branch February 23, 2026 16:40
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.

2 participants