Skip to content

feat(bashkit): Phase 12 - Spec test framework for compatibility testing#14

Merged
chaliy merged 3 commits intomainfrom
claude/bash-filesystem-library-cYGoo
Jan 31, 2026
Merged

feat(bashkit): Phase 12 - Spec test framework for compatibility testing#14
chaliy merged 3 commits intomainfrom
claude/bash-filesystem-library-cYGoo

Conversation

@chaliy
Copy link
Contributor

@chaliy chaliy commented Jan 31, 2026

Summary

  • Spec test framework inspired by just-bash with .test.sh format
  • 114 bash compatibility test cases covering echo, variables, functions, arithmetic, arrays, globs, pipes/redirects, command substitution
  • Text processing builtins tests: awk (19), grep (15), sed (17), jq (21)
  • Comparison runner to validate against real bash
  • KNOWN_LIMITATIONS.md documenting all gaps
  • Testing strategy spec (specs/004-testing.md)

Test Plan

  • cargo test passes (9 passed, 2 ignored)
  • cargo clippy clean
  • cargo fmt applied
  • CI passes

Current compatibility: 78.3% (83/106 tests passing)

Implements four major text processing commands:

- jq: JSON processor using the jaq library
  - Field access, array indexing, keys, length
  - Full jq filter syntax support

- grep: Pattern matching using regex crate
  - Flags: -i (case insensitive), -v (invert), -n (line numbers)
  - Flags: -c (count), -l (files), -F (fixed string), -E (extended)

- sed: Stream editor with substitution support
  - s/pattern/replacement/[g] substitution
  - Address ranges (line numbers, $, regex)
  - Delete (d) and print (p) commands
  - In-place editing with -i flag

- awk: Pattern scanning and processing
  - Field splitting with -F option
  - BEGIN/END blocks
  - Pattern matching (regex and expressions)
  - Built-in variables: NR, NF, FNR, FS, OFS, ORS
  - Functions: length, substr, index, split, gsub, sub, toupper, tolower
  - Arithmetic and string operations
  - Compound assignment operators (+=, -=, etc.)

Also fixes single-quoted string handling:
- Added LiteralWord token type for single-quoted strings
- Single-quoted strings no longer undergo variable expansion
- This fixes $1, $2 etc. being incorrectly expanded in awk/sed programs

Test coverage: 177 tests passing

https://claude.ai/code/session_01A16cD8ztbTJs2PB2iHe1Ua
Adds a comprehensive spec test framework inspired by just-bash:

- Spec test runner with .test.sh file format
- 114 bash compatibility test cases
- Text processing tests (awk, grep, sed, jq)
- Comparison runner against real bash
- KNOWN_LIMITATIONS.md documenting gaps
- Testing strategy spec (specs/004-testing.md)

Current compatibility: 78.3% (83/106 tests passing)

https://claude.ai/code/session_01A16cD8ztbTJs2PB2iHe1Ua
@chatgpt-codex-connector
Copy link

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@chaliy chaliy merged commit 1bdee21 into main Jan 31, 2026
1 check passed
@chaliy chaliy deleted the claude/bash-filesystem-library-cYGoo branch January 31, 2026 23: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