-
Notifications
You must be signed in to change notification settings - Fork 20
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 #186 from r-spatial/various
Smaller improvements
- Loading branch information
Showing
12 changed files
with
177 additions
and
78 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
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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
Package: qgisprocess | ||
Title: Use 'QGIS' Processing Algorithms | ||
Version: 0.1.0.9179 | ||
Version: 0.1.0.9180 | ||
Authors@R: c( | ||
person("Dewey", "Dunnington", , "[email protected]", role = "aut", | ||
comment = c(ORCID = "0000-0002-9415-4582", affiliation = "Voltron Data")), | ||
|
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.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
test_that("qgis_has_algorithm() works", { | ||
skip_if_not(has_qgis()) | ||
expect_true(qgis_has_algorithm("native:filedownloader")) | ||
expect_false(qgis_has_algorithm("notanalgorithm")) | ||
}) | ||
|
||
test_that("qgis_has_provider() works", { | ||
skip_if_not(has_qgis()) | ||
expect_true(qgis_has_provider("native")) | ||
expect_false(qgis_has_provider("notaprovider")) | ||
}) | ||
|
||
test_that("qgis_has_plugin() works", { | ||
skip_if_not(has_qgis()) | ||
expect_true(qgis_has_plugin("processing")) | ||
expect_false(qgis_has_plugin("notaplugin")) | ||
}) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
test_that("qgis_version() works", { | ||
skip_if_not(has_qgis()) | ||
|
||
expect_match(qgis_version(), "^\\d{1,2}\\.\\d+.*-.+") | ||
expect_match(qgis_version(full = FALSE), "^\\d{1,2}\\.\\d+.\\d+$") | ||
}) | ||
|
||
test_that("qgis_version(debug = TRUE) works", { | ||
skip_if_not(has_qgis()) | ||
skip_if( | ||
package_version(qgis_version(full = FALSE)) < "3.22.0", | ||
"QGIS version is older than 3.22.0" | ||
) | ||
|
||
capture.output({ | ||
expect_message( | ||
qgis_version(debug = TRUE), | ||
glue("Using.+{getNamespaceVersion('qgisprocess')}") | ||
) | ||
expect_message(qgis_version(debug = TRUE), "PROJ version") | ||
expect_message(qgis_version(debug = TRUE), "EPSG ") | ||
}) | ||
}) | ||
|
||
test_that("qgis_query_version() works", { | ||
skip_if_not(has_qgis()) | ||
|
||
expect_match(qgis_query_version(), "^\\d{1,2}\\.\\d+.*-.+") | ||
}) | ||
|
||
test_that("qgis_query_version() works for development versions of QGIS", { | ||
skip_if_not(has_qgis()) | ||
qversion <- qgis_query_version() | ||
skip_if_not( | ||
stringr::str_detect( | ||
qversion, | ||
"^\\d{1,2}\\.\\d*[13579][\\.-]" | ||
), | ||
paste("QGIS version", qversion, "is not a development version.") | ||
) | ||
|
||
expect_match( | ||
qversion, | ||
"^\\d{1,2}\\.\\d+.*-\\p{L}+, development state ([0-9a-f]{7,}|unclear:.+)", | ||
perl = TRUE | ||
) | ||
|
||
if (stringr::str_detect(qversion, ".+development state unclear:.+")) { | ||
expect_warning(qgis_query_version(), "version identifier") | ||
} | ||
}) |
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