Commit a17d25a
feat: associative arrays, chown/kill builtins, array slicing tests (#236)
## 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
- [x] All 27 new tests pass
- [x] `cargo test --all-features` passes (all 14 test suites)
- [x] `cargo clippy --all-targets --all-features -- -D warnings` clean
- [x] `cargo fmt --check` clean
- [x] Bash comparison tests pass (no mismatches with real bash)
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent a2717bd commit a17d25a
File tree
10 files changed
+594
-41
lines changed- crates/bashkit
- src
- builtins
- interpreter
- tests
- spec_cases/bash
- specs
- supply-chain
10 files changed
+594
-41
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
556 | 556 | | |
557 | 557 | | |
558 | 558 | | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
| 599 | + | |
| 600 | + | |
| 601 | + | |
| 602 | + | |
| 603 | + | |
| 604 | + | |
| 605 | + | |
| 606 | + | |
| 607 | + | |
| 608 | + | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
| 612 | + | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
| 619 | + | |
| 620 | + | |
| 621 | + | |
| 622 | + | |
| 623 | + | |
| 624 | + | |
| 625 | + | |
| 626 | + | |
| 627 | + | |
| 628 | + | |
| 629 | + | |
| 630 | + | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
| 636 | + | |
| 637 | + | |
| 638 | + | |
| 639 | + | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
559 | 645 | | |
560 | 646 | | |
561 | 647 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
81 | 81 | | |
82 | 82 | | |
83 | 83 | | |
84 | | - | |
| 84 | + | |
85 | 85 | | |
86 | 86 | | |
87 | 87 | | |
| |||
0 commit comments