Skip to content

Comments

feat: string ops, read -r, heredoc tests#237

Merged
chaliy merged 1 commit intomainfrom
claude/bashkit-bash-compatibility-BsDKD
Feb 23, 2026
Merged

feat: string ops, read -r, heredoc tests#237
chaliy merged 1 commit intomainfrom
claude/bashkit-bash-compatibility-BsDKD

Conversation

@chaliy
Copy link
Contributor

@chaliy chaliy commented Feb 23, 2026

Summary

  • Implement ${s/#pat/repl} prefix-anchored and ${s/%pat/repl} suffix-anchored pattern replacement
  • Implement ${var:?"msg"} error expansion with exit code 1
  • Handle \/ escape in pattern replacement parsing
  • Add read builtin -r flag (raw mode) and -p flag parsing
  • Add 31 new bash spec tests across 3 new test files (heredoc, string-ops, read-builtin)
  • Bash spec tests: 741 total, 735 pass, 6 skip (100% pass rate)
  • Bash comparison: 668/668 match real bash (100%)

Test plan

  • cargo test --all-features passes
  • cargo clippy --all-targets --all-features -- -D warnings clean
  • cargo fmt --check clean
  • Bash spec tests: 741 total, 0 failures
  • Bash comparison: 668/668 match (100%)

- Implement ${s/#pat/repl} prefix-anchored and ${s/%pat/repl}
  suffix-anchored pattern replacement
- Implement ${var:?"msg"} error expansion with exit code 1
- Handle \/ escape in pattern replacement parsing
- Add read builtin -r flag (raw mode, no backslash interpretation)
  and -p flag parsing
- Add 31 new bash spec tests:
  - heredoc.test.sh (9): variable expansion, quoted delimiters,
    file redirects, command/arithmetic substitution
  - string-ops.test.sh (15): prefix/suffix replace, :?, :+,
    case conversion, indirect expansion, negative substring
  - read-builtin.test.sh (7): IFS splitting, -r flag, here-string
- Bash spec tests: 741 total, 735 pass, 6 skip (100% pass rate)
- Bash comparison: 668/668 match real bash (100%)

https://claude.ai/code/session_012rzB3FRw7yoQWCG1mxyW7J
@chaliy chaliy merged commit a7dbdfd into main Feb 23, 2026
16 checks passed
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