Add test coverage for condformat_render.R and theme_kable.R - #59
Merged
Conversation
theme_kable.R had no dedicated test file at all. New test-theme-kable.R covers: wrapping a plain data.frame into a condformat_tbl, argument accumulation across chained calls, and explicitly resetting an argument to NULL (kable_args[paramname] <- list(NULL), distinct from removing it). condformat_render.R's knit_print.condformat_tbl(): added a test for the paginated-TRUE HTML branch (returns an htmlwidget via condformat2widget() rather than plain HTML). Also fixed a test-isolation bug in test-render-latex.R: "condformat2latex does not use longtable if disabled" set knitr::opts_current$set(longtable = FALSE) without ever resetting it, so the following "knitr latex returns LaTeX code" test silently inherited longtable = FALSE and never actually exercised the default (TRUE) longtable path this test suite otherwise never covered. Added on.exit cleanup and a new test asserting the "longtable" LaTeX dependency is added by default. No production code changes.
zeehio
force-pushed
the
claude/coverage-render-kable
branch
from
July 10, 2026 08:07
e490b9c to
63b1cc3
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
theme_kable.Rhad no dedicated test file at all (86% coverage, exercised only incidentally). Newtest-theme-kable.Rcovers:data.frameinto acondformat_tbl.theme_kable()calls.NULL(a distinct code path from omitting it:kable_args[paramname] <- list(NULL)).condformat_render.R'sknit_print.condformat_tbl()(89% coverage): added a test for the paginated-TRUEHTML branch, which returns an htmlwidget viacondformat2widget()rather than plain HTML — previously untested.While looking at the
use_longtabledefault-TRUEbranch (adding thelongtableLaTeX dependency), I found a test-isolation bug intest-render-latex.R:"condformat2latex does not use longtable if disabled"setknitr::opts_current$set(longtable = FALSE)without ever resetting it, so the following"knitr latex returns LaTeX code"test silently inheritedlongtable = FALSEand never actually exercised the default (TRUE) longtable path — meaning this branch was untested despite looking covered. Addedon.exitcleanup to that test and a new one asserting the"longtable"LaTeX dependency is added by default.No production code changes.
Test plan
rcmdcheck::rcmdcheck(): 0 errors, 0 warnings, only the pre-existing environment-only.claudeNOTE.Generated by Claude Code