Repository navigation
test(htmlgen): cover failure paths with whole-document fixtures (4/4) - #261
Conversation
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configuration
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (5)
Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review. 📝 WalkthroughWalkthroughThe change adds four invalid template fixtures and a test that checks their expected errors through both ChangesInvalid template checks
Priority: ⬇️ Low Estimated code review effort: 2 (Simple) | ~8 minutes Change: Other Merge Risk: ⚪ Minimal · up to The invalid-template fixtures exercise the intended errors; no actionable merge-blocking risk remains after normal checks. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 1 files. (4 skipped: 4 unsupported.) ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
51e5d10 to
4857580
Compare
Pins the error each broken template in testdata/invalid produces from both Validate and Generate: a syntax error and an unknown function (ErrParseTemplate), and a branch that ends in different contexts and an unclosed attribute (ErrUnsafeTemplate). Every invalid fixture must have an expected error, so a new one cannot be added untested.
4857580 to
c10532b
Compare
Problem
#260 pins what a correct template produces. Nothing yet pins what a broken one produces: the error a template author gets for each kind of mistake, and that
ValidateandGenerateagree on it.Changes
TestGolden_InvalidTemplatesrenders every template intestdata/invalid/with bothValidateandGenerate(against the permit data from #260) and requires the same sentinel error from each:syntax-error.tmpl{{ .nameleft unclosedErrParseTemplateunknown-function.tmplErrParseTemplatebranch-context.tmpl{{ if }}whose branches end in different HTML contextsErrUnsafeTemplateunclosed-attribute.tmplErrUnsafeTemplateThe test requires an expected error for every file in
testdata/invalid/, so a fixture cannot be added without one.Testing
Race-clean, 0 lint issues.
Related
Stacked chain — 4 of 4, review in order:
#258 core → #259 helpers and resolvers → #260 golden fixtures → this PR
Depends on #260; until it, #259 and #258 merge, this diff includes them.
Summary by CodeRabbit