-
Notifications
You must be signed in to change notification settings - Fork 2
Feature/tests test suite added using testthat and vdiffr #7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
dataquine
wants to merge
23
commits into
main
Choose a base branch
from
feature/tests
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
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
Ignore 'qa' directory
Reformat and Replace T or F as recommended by {goodpractice}
"avoid 'T' and 'F', as they are just variables which are set to the
logicals 'TRUE' and 'FALSE' by default, but are not reserved words and hence can be overwritten by the user. Hence, one should always use 'TRUE' and 'FALSE' for the logicals."
Using vdiffr requires R >= 4.1. We are using the new snapshot features so make vdiffr version a recent one.
These SVG files are generated by {vdiffr} and cached in the _snaps directory for snapshot usage.
Recommended by {goodpractice} to avoid situations where length(x) would be zero creating 1:0
avoid 1:length(...), 1:nrow(...), 1:ncol(...), 1:NROW(...) and 1:NCOL(...) expressions. They are error prone and result 1:0 if the expression on the right hand side is zero. Use seq_len() or seq_along() instead.
Test if an create a plot showing all the colours in the palette on the same row. This test makes use of {vdiffr} for visual regression testing.
Text reformat and replace usage of T with TRUE as recommended by {goodpractice}
This PDF seems to be auto generated when there is code that creates plots in plot window e.g. generate_palette with view_palette = TRUE
|
Added tests for helper_functions.R also additional tests for generate_palette to cover missing or empty modification parameter |
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.
Initial addition of testthat test suite with tests for
The testing uncovered a couple of edge cases that have failing tests so would suggest these would be candidates for fixing first.
Running the test suite generates a PDF which seems to contain the plots that end up in the plot window.
tests/testthat/Rplots.pdf
The {vdiffr} package is used for visual regression tests for view_palette().
N.B. due to the use of {vdiffr} the base requirement for R version has been set to at least 4.1.0 - don't know if that would be an issue for any current users?