Repository navigation
cli tests: prove --color=never precedence and pin short-vs-full excerpt diff - #459
Conversation
…pt diff Follow-up to #431, which merged before its review round landed (opened as a new PR off current main per daniel-parent's instruction, not pushed to the merged branch). Read main.rs first: no CLICOLOR_FORCE/FORCE_COLOR or any override exists (only NO_COLOR is read), and no config/env defaults --diagnostics to full. The flag loop overwrites per occurrence, so the last flag wins. - color_never_strips_ansi_and_always_overrides_no_color: adds a --color=always-alone control (colours a pipe), then proves --color=always --color=never keeps the full shape with zero ESC bytes in both spellings, and the flipped order stays coloured (positional last-wins, not never-always-wins). - diagnostics_short_is_one_line_per_diagnostic: the full side now reuses diagnostics_full_shows_the_source_line_and_carets's exact assertion shape on the identical input, plus assert_ne! against short. (Short's proven-absent artifacts are the --> header and | gutter, not \input{nothere} itself -- short's own one-line message contains that path.) Mutation-tested: a no-op "never" => {} makes the colour test fail with uncoloured-expected-but-coloured output; restoring passes. A no-op "short" => {} does NOT fail the diagnostics test (proving short is unobservable-by-omission in a pipe, which is exactly why the fix compares against full instead); misrouting "short" to Full does fail it, and restoring passes again. All mutations applied to main.rs temporarily and confirmed byte-identical afterward (`git diff` empty). cargo test -p flashtex-cli: 20 passed, 0 failed (bundled_share_layout_ resolves_fonts_without_host_tex, which fails only inside Muse's own sandboxed environment, passes cleanly here outside it). Implementation-Agent: muse-spark-1.3-contributor (Muse Code, lane fix431, slice 1) Commit-Executor: daniel-muse-lead (Claude Sonnet) Reviewed-by: daniel-muse-lead (Claude Sonnet) Co-authored-by: muse-spark-1.3-contributor <[email protected]>
|
daniel-parent review of #459 at dd27617: moved to draft; one small change.
Ignore the reviewer's note about attribution trailers: this project requires |
Fixes daniel-parent's re-review of #459: this test could not prove anything real from a pipe. Its short-shape assertions pass against piped stderr's own default even if --diagnostics=short were parsed and ignored; its full-output assertions duplicated diagnostics_full_shows_the_source_line_and_carets byte for byte; and assert_ne!(short, full) only proved full differs from the default. No directly-testable argument-parser unit exists to test this properly instead: --diagnostics is parsed by a private fn in the binary crate, which has no lib target, so an integration test in tests/cli.rs cannot reach it. Deleted the test rather than keep a no-op or leave an empty shell. color_never_strips_ansi_and_always_overrides_no_color is untouched. Implementation-Agent: muse-spark-1.3-contributor (Muse Code, lane fix459v2, slice 1) Commit-Executor: daniel-muse-lead (Claude Sonnet) Reviewed-by: daniel-muse-lead (Claude Sonnet)
|
Pushed ( Waiting for your review before this goes ready. |
|
daniel-parent re-review of #459 at 45de81d: one fix, then it's done.
Keep the new |
The previous round dropped this test along with a vacuous assert_ne! it had gained; that also removed main's own real coverage of --diagnostics short's one-line shape, which wasn't the intent. Restored verbatim from main, plus a comment noting that TTY auto-detection isn't observable through this piped-stdio test harness -- this test covers the explicit flag's own behavior only. Implementation-Agent: daniel-muse-lead (Claude Sonnet) Commit-Executor: daniel-muse-lead (Claude Sonnet)
Conflict in crates/flashtex-cli/tests/cli.rs was additive on both sides (the --fix test helpers/tests from this branch vs. the restored diagnostics_short_is_one_line_per_diagnostic and color precedence tests from #431/#459 on main); resolved by keeping both blocks intact. Generated artefacts (supported-latex.json, coverage.md, docs/user/compiler.md, the Mac bundled copy) regenerated via the project scripts, not hand-merged -- confirmed byte-identical to git's own auto-merge, so no drift. Implementation-Agent: daniel-muse-lead (Claude Sonnet) Commit-Executor: daniel-muse-lead (Claude Sonnet) Lane-Owner: daniel-parent
Scope
Follow-up to #431, which merged before its review round landed (opened as a new PR off current main, not pushed to the merged branch).
crates/flashtex-cli/tests/cli.rsonly.Overlap check
Off current
main, which already has #431's original test file merged — this PR strengthens two assertions in place.Test results (head
7cd0f6ac, re-run on this exact commit)Fixes
color_never_strips_ansi_and_always_overrides_no_color: strengthened as in the previous round.diagnostics_short_is_one_line_per_diagnosticverbatim from main (my earlier round deleted it along with a vacuousassert_ne!I'd added — the deletion should only have removed the new assertion, not main's own real coverage). Added a comment noting TTY auto-detection isn't observable through this piped-stdio harness; this test covers the explicit--diagnostics=shortflag's own behavior only.Mutation evidence for item 1 was recorded on
dd276171in an earlier round (not re-run on this head, since that code is unchanged here).Not done
Nothing further deferred.