Repository navigation
test: add color tag rendering coverage (framework#1571) - #158
Open
goravel-coder wants to merge 1 commit into
Open
goravel-coder wants to merge 1 commit into
goravel-coder wants to merge 1 commit into
Conversation
Bump github.com/goravel/framework to v1.18.1-0.20261013093243-4da928651f19 (head of framework PR #1571) and add the `test:console-color` command plus feature tests confirming gookit-based tag rendering, StripColor, disable/enable toggling, and TwoColumnDetail width measurement. The framework bump also pulls in the PR head's transitive dependency drift (gookit/color v1.6.1, pterm v0.12.84, go-runewidth v0.0.31, and the newer otel/x/grpc versions required by that commit).
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.
Summary
github.com/goravel/frameworktov1.18.1-0.20261013093243-4da928651f19, the head of framework PR #1571, restoring<red>/<fg=green>color-tag rendering that pterm v0.12.84 had dropped.test:console-colorexample command and feature tests asserting tagged output renders to ANSI instead of leaking into the terminal as literal text.color.StripColor,color.Disable()/color.Enable()toggling, andTwoColumnDetailmeasuring tagged text by its rendered width so colored columns stay aligned.Why
Goravel renders console color tags such as
<fg=green>ok</>through gookit/color. Framework PR #1571 ("restore color tag rendering for pterm v0.12.84 via gookit/color") re-addedgookit/colorv1.6.1 as a direct dependency after pterm v0.12.84 stopped bundling it, so tags are parsed again instead of leaking as literal text. This branch bumps the example app to that PR head and confirms the restored behavior from the example app itself, so a future dependency update cannot silently regress it. The bump also pulls in the PR head's transitive dependency drift: gookit/color v1.6.1, pterm v0.12.84, go-runewidth v0.0.31, and the newer otel/x/grpc versions that commit requires.Before the fix, tags were printed literally, so colored output had to be pre-rendered by hand, and
support/consolemeasured column widths on the raw tag text, which skewed alignment. After the fix, tags resolve to ANSI and widths are measured on the rendered text, so tagged and pre-colored forms produce identical layout.Note: the
tests/featuresuite boots Artisan with--no-ansi, which latches color off for the whole process, soTestRunColorCommandperforms a discarded warm-up run to clear that flag before the asserted run.