Repository navigation
test: add view function coverage for framework#1589 - #161
Merged
Merged
Conversation
hwbrzzl
force-pushed
the
ship/2026-10-26-view-pr-1589-tests
branch
2 times, most recently
from
October 27, 2026 08:53
4ca6193 to
0906c12
Compare
goravel-agent
force-pushed
the
ship/2026-10-26-view-pr-1589-tests
branch
from
October 31, 2026 02:37
0906c12 to
6d2af33
Compare
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
WithViewFuncs,View.AddFuncs,View.Funcs, and the shared view compiler wiring, with render results asserted end-to-end under both the gin and fiber drivers.ViewTestSuitepin the app function render, the package function render, the app-over-package name override, the merged registry returned byFuncs(), and the fact thatFuncs()hands back an independent copy.WithViewFuncsinbootstrap/app.go, packageAddFuncsinpackages/viewtest/service_provider.go, three named-template fixtures, and a/view-funcs/{app,package,override}route group.Why
This branch adds application-level coverage for goravel/framework#1589. Template functions registered by the application and by package providers both have to land on the driver's template set, and the application's registration has to be applied last so it wins a name collision. The example app now exercises that path through real routes and asserts the rendered HTML, so a regression in either driver surface fails loudly instead of passing silently.
The contested name lives in one place:
viewtest.GreetingFuncNameis registered by both the package provider and the application, so a rename breaks the build instead of quietly dropping the override coverage, and the registry test asserts membership of the expected names rather than an exact sorted set, so a newly framework-registered function does not fail it.The branch is rebased onto current
master, so both sides of the earlier conflict survive: master'sview-csrfcoverage (TestRender_CsrfField,TestRender_StringMapDataWithCsrfField) and this PR'sview-funcscoverage run side by side.Dependencies track upstream rather than a fork. The
github.com/protibimbok/*replaceblock is gone fromgo.modandgo.sum, so there is nothing left to drop before merging; gin and fiber now resolve from their canonical modules at the heads that landed in goravel/gin#261 (v1.18.1-0.20261030085342-4d9429b10cb3) and goravel/fiber#315 (v1.18.1-0.20261030085228-66c98dc71f1d), which are the only canonical pin until either repo cuts av1.18.1tag.github.com/goravel/frameworkstays pinned atv1.18.1-0.20261029110755-f9582c05db52through the require + self-replacepair carried by master, so the older framework version gin and fiber ask for cannot downgrade the code compiled here.