Add 71 comprehensive tests to increase code coverage#18
Merged
rkillick merged 1 commit intorkillick:mainfrom Mar 26, 2026
Merged
Add 71 comprehensive tests to increase code coverage#18rkillick merged 1 commit intorkillick:mainfrom
rkillick merged 1 commit intorkillick:mainfrom
Conversation
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
This PR introduces a new test suite (
test_new_coverage.R) containing 71 comprehensive tests targeting the changepoint regression functions. It significantly increases the package's code coverage, specifically aiming at the previously untested non-exported functions and edge cases in model selection.Code Coverage Impact
Overall package coverage increased from 0.97% to 59.25%.
R/CptReg.R: 0.00% ➔ 94.35%R/envcpt.R: 0.00% ➔ 80.45%src/C_cptreg.c: 1.77% ➔ 83.63%Tests Added (71 Total)
1.
cpt.reg(Input Validation & Functionality):tol,minseglenbounds).minseglenwarnings and errors.cpt.reg), plus tests forclass=FALSEandparam.estimates=FALSE.AIC,BIC,shapeparameters for RSS and fixed variance).2.
check_data&ChangepointRegression(Internal Routing):cpts.onlysorting logic.3.
envcpt(Model Subsets):models = "meanar1cpt",models = c(5, 6)).minseglenpropagation to internal calls.4. Penalty Weights & C-Level Dispatch (
AICweights,BIC,CptReg_*):CptReg_AMOC_NormalandCptReg_PELT_Normal.GSoC 2026 Contributor Test Submission
Contributor: Pratik (@Delta17920)