Add comprehensive test coverage for underdocumented exported functions #311
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.
Addresses the tracking issue to ensure every documented behavior is tested and every tested behavior is documented for exported functions.
Changes
Enhanced test coverage (+305 lines across 4 files):
animateSpectra: 1→11 tests covering all parameters (species filtering, time_range vectors, wlim/ylim with NA handling, power values 0/1/2/custom, total/resource flags, input validation)
Predation kernels: Enhanced box_pred_kernel boundary conditions and parameter validation; added tests for lognormal_pred_kernel (peak location, ppmr<1 zeros), truncated_lognormal_pred_kernel (truncation behavior), power_law_pred_kernel (sigmoidal cutoffs)
Reproduction functions: Added BevertonHoltRDD R_max validation, constantRDD/noRDD basic tests
Distance functions: Added distanceMaxRelRDI and distanceSSLogN tests (non-negativity, zero-distance identity, zero-abundance handling)
Helper functions: Added constant_other test
Verified adequate coverage for 20+ functions including compareParams, selectivity functions, size bins (w/dw/w_full/dw_full), getters (get__default), validators (valid, validParams), and resource dynamics.
All tests follow existing testthat patterns and use established fixtures (NS_params).
Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
cloud.r-project.org/usr/lib/R/bin/exec/R --no-echo --no-restore -e .libPaths('~/R/library');~+~install.packages('devtools',~+~repos='REDACTED',~+~Ncpus=4)(dns block)esm.ubuntu.com/usr/lib/apt/methods/https(dns block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
This section details on the original issue you should resolve
<issue_title>Check for all functions that documentation and tests agree</issue_title>
<issue_description>Every aspect of a function that is documented should be tested. That way we will never break things unexpectedly that the user has a right to expect will work. I expect that we will need to add a lot more tests.
Conversely, if a behaviour is being tested, then that behaviour should be something the reader of the documentation will expect. I suspect that while looking over the tests we will get ideas of how to clarify the documentation.
Here is an alphabetical list of currently exported functions, so that we can check off any where we are happy with both documentation and tests.
</issue_description>
Comments on the Issue (you are @copilot in this section)
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.