-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #125 from njtierney/add-tile-tests
Add more testing
- Loading branch information
Showing
15 changed files
with
132 additions
and
62 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,3 +21,4 @@ | |
^doc$ | ||
^Meta$ | ||
^codemeta\.json$ | ||
^\.covrignore$ |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
R/release_bullets.R |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# check_user_resources works | ||
|
||
Code | ||
check_user_resources(resources = c(custom_format = 1)) | ||
Condition | ||
Error: | ||
! "custom_format" cannot be supplied to targets created with `tar_terra_rast()` | ||
We see in `names(resources)`: | ||
"custom_format" | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# tile_n fails with non integer | ||
|
||
Code | ||
tile_n(r, n = 3.14) | ||
Condition | ||
Error in `tile_n()`: | ||
! 3.14 must be an integer. | ||
We see that "n" is: 3.14 | ||
|
||
--- | ||
|
||
Code | ||
tile_n(r, n = 4) | ||
Message | ||
creating 2 * 2 = 4 tile extents | ||
Output | ||
[[1]] | ||
xmin xmax ymin ymax | ||
5.741667 6.141667 49.816667 50.191667 | ||
[[2]] | ||
xmin xmax ymin ymax | ||
6.133333 6.533333 49.816667 50.191667 | ||
[[3]] | ||
xmin xmax ymin ymax | ||
5.741667 6.141667 49.441667 49.816667 | ||
[[4]] | ||
xmin xmax ymin ymax | ||
6.133333 6.533333 49.441667 49.816667 | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
test_that("check_user_resources works", { | ||
expect_snapshot( | ||
error = TRUE, | ||
check_user_resources(resources = c("custom_format" = 1)) | ||
) | ||
expect_silent( | ||
check_user_resources(resources = c("anything else" = 1)) | ||
) | ||
}) |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
test_that("tile_n fails with non integer", { | ||
f <- system.file("ex/elev.tif", package = "terra") | ||
r <- terra::rast(f) | ||
expect_snapshot( | ||
error = TRUE, | ||
tile_n(r, n = 3.14) | ||
) | ||
skip_on_ci() | ||
expect_snapshot( | ||
tile_n(r, n = 4) | ||
) | ||
}) |