Skip to content

Add focused coverage tests for plot and diagnostics#19

Open
ArslanBatyrov wants to merge 5 commits intorkillick:mainfrom
ArslanBatyrov:add-coverage-tests
Open

Add focused coverage tests for plot and diagnostics#19
ArslanBatyrov wants to merge 5 commits intorkillick:mainfrom
ArslanBatyrov:add-coverage-tests

Conversation

@ArslanBatyrov
Copy link
Copy Markdown

This PR adds two focused test files to increase coverage in EnvCpt:

  • test-plot-extra.R for plot.envcpt() argument validation and behaviour
  • test-diagnostics-extra.R for AIC / AICweights diagnostics behaviour

I ran the full local test suite with NOT_CRAN=true, and it completed with no failures.

I also compared package coverage on upstream main versus this branch using covr::package_coverage().

Coverage summary:

File Before After
Overall 87.02% 87.81%
R/diagnostics.R 80.08% 82.57%
src/C_cptreg.c 85.60% 85.60%
R/CptReg.R 94.35% 94.35%
R/envcpt.R 95.49% 95.49%

While adding diagnostics tests, I also noticed a likely separate bug in BIC.envcpt when n is supplied explicitly.

Reproducible example:

set.seed(1)
x <- c(rnorm(100, 0, 1), rnorm(100, 5, 1))
out <- envcpt(x)
BIC(out, n = length(x))

@ArslanBatyrov ArslanBatyrov marked this pull request as ready for review March 27, 2026 11:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant