Skip to content

test: add unit tests for combine_supp function#134

Open
ankonyeni wants to merge 1 commit intopharmaverse:mainfrom
ankonyeni:feat/test-combine-supp
Open

test: add unit tests for combine_supp function#134
ankonyeni wants to merge 1 commit intopharmaverse:mainfrom
ankonyeni:feat/test-combine-supp

Conversation

@ankonyeni
Copy link

This PR adds unit tests for the combine_supp() function in R/supp.R. These tests specifically target input validation and variable names collisions to ensure the function fails gracefully with informative error messages when provided with invalid inputs.

Changes
Added test cases to tests/testthat/test-supp.R to verify:

  1. Input Type Validation: Ensures both dataset and supp arguments are data frames.
  2. Column Collision Detection: Verifies that the function errors out if a variable name in the supplemental dataset (QNAM) already exists in the parent domain, preventing accidental overwriting of data.

@codecov-commenter
Copy link

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 83.56%. Comparing base (111fd3b) to head (c497b60).
⚠️ Report is 104 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #134      +/-   ##
==========================================
+ Coverage   82.19%   83.56%   +1.36%     
==========================================
  Files           7        7              
  Lines         691      803     +112     
==========================================
+ Hits          568      671     +103     
- Misses        123      132       +9     

see 4 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

2 participants