Add printf alphabet matrix (mix bash_fixtures.gen printf) - #100
Merged
Conversation
Enumerate every documented printf conversion across flags, widths, precisions, *, %b/%q inputs, and format recycling, the same way date_matrix already works. Gaps are marked with reasons rather than omitted; recordings were taken from GNU bash 5.2 via runner.sh. Co-authored-by: Dave Lucia <davelucianyc@gmail.com>
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 printf only: a generated
printf_matrixsuite in the same generate / record / test path asdate_matrix.The old by-example
printf.json(6 cases) is unchanged. Oilsbuiltin-printf.test.shis a cross-check, not this matrix.What was enumerated
mix bash_fixtures.gen printfwrites 595 cases:%s %c %d %i %u %o %x %X %f %e %E %g %G %a %A %%, plus bash extras%band%qhivs empty,7vs255,-1vs0)-,+, space,0,#) crossed with every conversion, and again with width 51/5/10, precisions0/2/6and empty%.d, plus%5.2*forms (%*,%.*,%*.*, flag+*) — extra arguments are the width/precision, not the value%binputs that make escapes visible (\t,\n,\x41,\101,\c)%qinputs that make shell-quoting visible (empty, space, quote,$HOME,*,-n)printf '%s' a b c, mixed%s:%d,%b/%qrecycle)--,-v,-Z,%(fmt)Tmix bash_fixtures.gen printf --dry-runreportsprintf_matrix: 595 cases.mix bash_fixtures.gennow generates bothdateandprintf.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, then pretty-printed throughMix.Tasks.BashFixtures.write_json!/2:To re-record through Docker when it is available:
\xffis not in the matrix:jq --rawfilereplaces invalid UTF-8, so that cell would be a harness artifact. The existing unit test still covers it.Known gaps (467 of 595)
No cell was omitted. Divergences are
opts.known_gap(excluded from the digest). The fixture runner still executes them with the assertion inverted.%i %u %E %g %G %a %A %q) passed through literally*for width/precision not implemented+, space,#format flags not implemented%euses Erlang~e(exponent width / default digits differ)%%%.d) is not parsed0xff, octal010,\'A, leading spaces%o/%x/%Xof-1printed signed; bash unsigned-wraps 64-bit0-padding honoured on%s/%c/%b; bash ignores0there%bignored%cof empty/missing emits nothing; bash emits NUL%(fmt)Tnot implemented%b\NNNoctal (only\0NNN, matchingecho -e)%b\cterminator%0-5dflag order not parsed--treated as the format-vtreated as the format-Zabsorbed as the format, exit 0JustBash.exec/2 did not raise on any cell. No printf implementation bugs were fixed in this PR — it is the enumeration + harness. Cheap follow-ups the matrix now makes un-skippable:
%ias a%dalias, unsigned wrap,+//#flags,*,%q.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— 6094 tests, 0 failuresmix test --only suite:printf_matrix— 595 tests, 0 failuresRelated Issues
Related to #70 (item 2 only; not closing the issue)
Type of Change
Testing
mix bash_fixtures.gen printf --dry-run, local runner.sh recording, JustBash vs oracle classification)Checklist
mix formatmix credoand addressed any issues