Adding unit test from co-pilot (worked surprisingly well)#86
Merged
smasongarrison merged 11 commits intomainfrom Nov 4, 2025
Merged
Adding unit test from co-pilot (worked surprisingly well)#86smasongarrison merged 11 commits intomainfrom
smasongarrison merged 11 commits intomainfrom
Conversation
Co-authored-by: smasongarrison <6001608+smasongarrison@users.noreply.github.com>
Co-authored-by: smasongarrison <6001608+smasongarrison@users.noreply.github.com>
Co-authored-by: smasongarrison <6001608+smasongarrison@users.noreply.github.com>
…rage-build-spouse-segments Add test coverage for buildSpouseSegments in calcConnections.R
Added comprehensive test coverage for buildSpouseSegments, including cases for use_hash and spouseID logic, NA handling, and intermediate column removal. Updated documentation in R and Rd files to clarify the connections_for_FOO parameter. NEWS.md updated to reflect new test coverage.
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR adds comprehensive test coverage for the buildSpouseSegments function. The changes include:
- Added 13 new test cases covering both
use_hash=TRUEanduse_hash=FALSEmodes - Updated documentation to clarify that
connections_for_FOOcontains connections from parent connections - Updated version number to development version (0.9.1.9000)
- Added NEWS entry documenting the test coverage addition
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| tests/testthat/test-calcConnections.R | Added 13 comprehensive test cases for buildSpouseSegments function covering both hash-based and spouse-based segment building |
| man/buildSpouseSegments.Rd | Enhanced parameter documentation for connections_for_FOO |
| R/calcConnections.R | Enhanced parameter documentation for connections_for_FOO |
| NEWS.md | Added entry for test coverage addition and removed misplaced comment |
| DESCRIPTION | Bumped version to development version 0.9.1.9000 |
Comments suppressed due to low confidence (2)
tests/testthat/test-calcConnections.R:1
- Trailing backslash at the end of comment should be removed.
test_that("calculateConnections returns expected columns and structure", {
NEWS.md:8
- Removed a standalone '## cran release' comment. Ensure this removal is intentional and doesn't affect the structure or meaning of the changelog for version 0.8.0.
## cran release
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
This pull request introduces comprehensive test coverage for the
buildSpouseSegmentsfunction, clarifies documentation, and updates the package version to reflect ongoing development. The main focus is on ensuring the correctness and robustness of spouse segment construction logic under various scenarios.Testing improvements:
buildSpouseSegmentsfunction intests/testthat/test-calcConnections.R, covering bothuse_hash=TRUEanduse_hash=FALSEmodes, edge cases (missing or unmatched IDs), and validation of output structure and cleanup of intermediate columns.Documentation updates:
connections_for_FOOparameter in the documentation for both the function (R/calcConnections.R) and its manual page (man/buildSpouseSegments.Rd), specifying that it contains connections for spouse segments from parent connections. [1] [2]Package maintenance:
DESCRIPTIONto0.9.1.9000to indicate a development build.NEWS.mdto document the new test coverage forbuildSpouseSegments.NEWS.mdfor clarity, removing redundant lines.