Skip to content

Bash compatibility at about ~75% #27

@mattmc3

Description

@mattmc3

I made a fork of Bash and have been working through its test suite by converting it to Ruby test files for rubish in a branch. That branch isn't meant to feed into the actual upstream rubish project, though I guess you could if you wanted. I am more using it to gather information on where the Bash syntax parity gaps still are so I could submit fixes.

Things are looking pretty good! It looks like about 75% of the bash suite tests pass. If you want to see the gaps that remain, you can find the test files I generated here (./tests/test_bash_suite_*.rb).


Current state: 438 bash suite parity tests, 331 passing, 107 omitted (75%)

Each omitted test is marked with an omit reason rather than a failure, so the suite stays green. Omits identify unimplemented features, not regressions.

What's covered

27 test files covering: arith, arith-for, array, appendop, braces, builtins,
case, comsub, cond, exp/new-exp/more-exp, func, heredoc/herestr, ifs, invert,
loops, nquote, posixpat, posixpipe, printf, quote, read, redir, strip, subshell,
test, tilde, varenv.

Top gaps to close (by omissions unblocked)

  1. POSIX character classes [[:alpha:]] etc. in case/glob — 15 tests
  2. Arith operators ==, !=, +=/-=/etc., prefix ++/--, (()) null expr, short-circuit &&/|| — ~17 tests
  3. $'...' ANSI C quoting — 8 tests
  4. Functions: IOError on define/call — 5 tests
  5. Tilde expansion (~, ~/path, in assignments) — 5 tests
  6. read x <<<val here-string with read — 5 tests
  7. Multi-line heredoc in REPL — 5 tests
  8. Anchored substitution ${x/#pat/rep} / ${x/%pat/rep} — 4 tests
  9. IFS word splitting in for loop — 4 tests
  10. return N in functions — uncaught :return throw — 3 tests

Not yet converted (practical)

alias, assoc, attr, casemod, comsub2, extglob, getopts, glob, ifs-posix,
nameref, parser, posixexp, precedence, set-e, set-x, shopt, tilde2, trap, type,
vredir, and more.

Full tracking doc: test_bash_suite.md

I'm not sure if you are interested in taking a crack at any of the remaining ones or not @amatsuda. I am not sure how much time I will have this week to do any more of these, but if you have a preference for any of them, let me know in the comments on this issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions