Add ${var op word} alphabet matrix (mix bash_fixtures.gen varop) - #103
Merged
Conversation
Enumerate POSIX/bash parameter-expansion forms crossed with unset/empty/foo/foobar for #70 item 2. Record gaps with reasons; do not omit cells. Co-authored-by: Dave Lucia <davelucianyc@gmail.com>
davydog187
marked this pull request as ready for review
August 23, 2026 15:13
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements #70 item 2 for
${var op word}parameter expansion only: a generatedvarop_matrixsuite in the same generate / record / test path asdate_matrix,printf_matrix, andtest_matrix.This is not the item-3 filesystem-shape × command cube, Oils activation, or CI topology.
What was enumerated
mix bash_fixtures.gen varopwrites 270 cases. Suite name isvarop_matrix(notparam_matrix, to keep it distinct from the hand-writtenparameter_expansionsuite).-:-=:=+:+?:?× unset / set-empty /foo/foobar× nonempty vs empty word${v:-1}next to${v: -1}so a parser cannot hide the colon/space distinction behindword${#v}at the same four states${v:offset}/${v:offset:len}including:3(empty vsbar),:1:3,: -N,::2,:0:-1###%%%× literal / glob / empty pattern, plusfoofoowhere shortest vs longest actually splits///× first-vs-all (ooccurs twice), match vs miss, delete, empty-pattern forms, andfoofoofor first vs all offooset -ucells so unset-safe word-ops stay recorded next to${#v}/ substring / removal / replacement, which bash still treats as unboundecho "[${v-word}]");set +uis explicit except the nounset cellsmix bash_fixtures.gen varop --dry-runreportsvarop_matrix: 270 cases.mix bash_fixtures.gennow generates date, printf, test, and varop.Recording
Docker was not available on the agent VM. Oracle output was recorded with the same
test/fixtures/runner.shthe Docker task runs, under GNU bash 5.2.21 / Ubuntu 24.04 (uidubuntu, not root), then pretty-printed throughMix.Tasks.BashFixtures.write_json!/2:To re-record through Docker when it is available:
Known gaps (18 of 270)
No cell was omitted. Divergences are
opts.known_gap(excluded from the digest). The fixture runner still executes them with the assertion inverted.${v?}/${v:?}returns empty and continues; bash writes a diagnostic and abortsset -uon${#v}/${v:0}/${v#x}/${v/x/y}of unset: JustBash treats empty; bash errors unbound variable#*/%*consumes one character; bash's shortest*match is empty so the value is unchanged${v:0:-1}on empty is empty at exit 0; bash errorssubstring expression < 0Matching siblings are left unmarked (for example
${v?}on a set value,${v##*},${v:0:-1}onfoo).JustBash.exec/2 did not raise on any cell. No expansion implementation bugs were fixed in this PR — it is the enumeration + harness.
Cheap follow-ups the matrix now makes un-skippable
${v?}/${v:?}should write the diagnostic and abortset -ushould error on${#unset}/${unset:offset}/${unset#pat}/${unset/pat}#*/%*should match the empty stringNot in this PR: the item-3 FS-shape × command cube, Oils activation, CI topology changes.
Tests
All local quality gates passed:
mix compile --warnings-as-errorsmix format --check-formattedmix credo --strict(only the existing intentionalbanned_fixture_applyfinding)mix dialyzer(zero new errors)mix test— 6622 tests, 0 failuresmix bash_fixtures.gen varop --dry-run—varop_matrix: 270 casesRelated Issues
Related to #70 (item 2,
${var op word}only; not closing the issue)Type of Change
Testing
mix bash_fixtures.gen varop --dry-run, local runner.sh recording, JustBash vs oracle classification)Checklist
mix formatmix credoand addressed any issues