Skip to content

test: add 14 Oils-inspired spec test files (244 tests)#351

Merged
chaliy merged 1 commit intomainfrom
claude/research-agentic-bash-2xCO2
Feb 27, 2026
Merged

test: add 14 Oils-inspired spec test files (244 tests)#351
chaliy merged 1 commit intomainfrom
claude/research-agentic-bash-2xCO2

Conversation

@chaliy
Copy link
Contributor

@chaliy chaliy commented Feb 27, 2026

Summary

  • Add 14 new spec test files inspired by the Oils (oilshell) test suite covering previously untested bash behaviors
  • 244 new tests total: 108 passing, 136 skipped with TODO markers identifying unimplemented features
  • Each file links to the original Oils test for reference

High-value test coverage (7 files, 139 tests):

File Tests Pass Skip Gaps found
word-split.test.sh 39 3 36 IFS splitting, $@/$*, word elision
quote.test.sh 22 11 11 $'', $"", adjacent single quotes
parse-errors.test.sh 18 7 11 Incomplete constructs, unterminated quotes
shell-grammar.test.sh 22 22 0 All pass
empty-bodies.test.sh 8 3 5 Empty loop/function bodies not rejected
exit-status.test.sh 17 8 9 Exit code not truncated to 8-bit
subshell.test.sh 13 9 4 Function/cd/trap/positional leak

Medium-value test coverage (7 files, 105 tests):

File Tests Pass Skip Gaps found
nameref.test.sh 14 0 14 local -n/typeset -n not implemented
var-op-test.test.sh 19 5 14 ${@-val}, ${arr[@]+val}, backslash escapes
heredoc-edge.test.sh 16 10 6 Multiple heredocs in conditions, pipe ordering
unicode.test.sh 17 11 6 $'\u...', printf \u, ${#x} byte vs char
alias.test.sh 15 0 15 Alias expansion not implemented
temp-binding.test.sh 10 10 0 All pass
arith-dynamic.test.sh 14 9 5 Recursive var deref, array access in $((...))

Test plan

  • cargo test --test spec_tests passes (all 13 suites green)
  • cargo test --test spec_tests -- bash_comparison_tests passes
  • Rebased on latest main
  • No conflicts with recent main changes

Add comprehensive spec tests for bashkit behaviors not previously covered,
inspired by the Oils (oilshell) test suite methodology. Each file links to
the original Oils test for reference.

New test files (high-value gaps):
- word-split.test.sh: 39 tests for IFS, $@/$*, word elision (36 skipped)
- quote.test.sh: 22 tests for quoting edge cases (11 skipped)
- parse-errors.test.sh: 18 tests for parser error detection (11 skipped)
- shell-grammar.test.sh: 22 tests for grammar edge cases (0 skipped)
- empty-bodies.test.sh: 8 tests for empty loop/function bodies (5 skipped)
- exit-status.test.sh: 17 tests for exit code propagation (9 skipped)
- subshell.test.sh: 13 tests for subshell isolation (4 skipped)

New test files (medium-value gaps):
- nameref.test.sh: 14 tests for local -n / typeset -n (14 skipped)
- var-op-test.test.sh: 19 tests for ${:-} ${:+} ${:=} ${:?} (14 skipped)
- heredoc-edge.test.sh: 16 tests for heredoc edge cases (6 skipped)
- unicode.test.sh: 17 tests for unicode handling (6 skipped)
- alias.test.sh: 15 tests for alias expansion (15 skipped)
- temp-binding.test.sh: 10 tests for FOO=bar cmd (0 skipped)
- arith-dynamic.test.sh: 14 tests for dynamic arithmetic (5 skipped)

Total: 244 new tests, 108 passing, 136 skipped with TODO markers.

https://claude.ai/code/session_01PaZ7p23KzidUUWEP5DwDYN
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