Skip to content

fix(builtins): resolve 10 eval-surfaced interpreter bugs#216

Merged
chaliy merged 1 commit intomainfrom
claude/fix-ignored-tests-ieVcu
Feb 18, 2026
Merged

fix(builtins): resolve 10 eval-surfaced interpreter bugs#216
chaliy merged 1 commit intomainfrom
claude/fix-ignored-tests-ieVcu

Conversation

@chaliy
Copy link
Contributor

@chaliy chaliy commented Feb 18, 2026

Summary

  • Fix 7 bugs across tail, tr, grep, sed, awk, and the interpreter, unignoring all 10 eval-surfaced test cases from test: add skipped tests for eval-surfaced interpreter bugs #214
  • Add BRE (Basic Regular Expression) support to grep and sed — literal ( ) are now correctly distinguished from group metacharacters \( \)
  • Implement VFS script execution by absolute path after chmod +x

Changes

Bug Fix Files
tail -n +N returns wrong lines Parse +N prefix, add take_from_line() headtail.rs
tr '[:lower:]' '[:upper:]' garbled Implement POSIX character class expansion cuttr.rs
grep 'feat(' crashes (unclosed group) Add bre_to_ere() conversion in default mode grep.rs
sed BRE capture groups fail with literal () Add bre_to_ere() conversion for BRE patterns sed.rs
awk match($0, /re/, arr) produces no output Support 3rd-arg capture array (gawk extension) awk.rs
/tmp/script.sh after chmod +x → command not found Check VFS execute permission, parse and run script mod.rs
awk '{total += $2 * $3}' wrong result Already worked — test was incorrectly skipped
while read in pipe empty vars Already worked — test was incorrectly skipped
sed -E ERE capture groups Already worked — test was incorrectly skipped

Skipped test count: 87 → 77 (bash comparison: 488 → 492 matching real bash)

Test plan

  • cargo fmt --check
  • cargo clippy --all-targets --all-features -- -D warnings
  • cargo test --all-features — all pass
  • All 10 previously-skipped spec tests now pass
  • Bash comparison tests: 492/492 match real bash (100%)

Fix 7 bugs and unignore 10 previously-skipped spec tests:

- tail: support `tail -n +N` (start from line N) syntax
- tr: implement POSIX character classes ([:lower:], [:upper:], etc.)
- grep: add BRE mode — literal ( ) are escaped, \( \) become groups
- sed: proper BRE-to-ERE conversion for patterns with literal parens
- awk: implement match() 3rd-arg capture array (gawk extension)
- interpreter: execute VFS scripts by path after chmod +x

Tests fixed: tr_class_upper_from_pipe, while_read_pipe_vars,
tail_plus_n_offset, script_chmod_exec_by_path, grep_bre_literal_paren,
grep_bre_literal_paren_pattern, awk_field_multiply_accumulate,
awk_match_capture_array, sed_capture_group_complex_bre,
sed_ere_capture_group_extract

Skipped test count: 87 → 77

https://claude.ai/code/session_016XS5TJwtYPBB7ao42BTFNx
@chaliy chaliy force-pushed the claude/fix-ignored-tests-ieVcu branch from c0d3b4e to 01e16d8 Compare February 18, 2026 01:13
@chaliy chaliy merged commit 9c2b4c4 into main Feb 18, 2026
15 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