-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix keyword in getCranPackageDatabase()
and prove that this function returns exactly the same as tools::CRAN_package_db()
- Loading branch information
Showing
2 changed files
with
13 additions
and
29 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,35 +1,12 @@ | ||
# | ||
# This file was generated by kwb.test::create_test_files(), | ||
# launched by hsonne on 2024-05-02 17:58:26. | ||
# Please modify the dummy functions so that real cases are | ||
# tested. Then, delete this comment. | ||
# | ||
#library(testthat) | ||
|
||
test_that("getCranPackageDatabase() works", { | ||
|
||
f <- kwb.package::getCranPackageDatabase | ||
|
||
expect_error( | ||
f() | ||
# No such element in list 'urls': | ||
# - 'cran_packages' | ||
# Available elements (sorted): | ||
# - 'cached_desc' | ||
# - 'cran' | ||
# - 'cran_archive' | ||
# - 'cran_archive_file' | ||
# - 'cran_contrib' | ||
# - 'cran_package' | ||
# - 'cran_package_file' | ||
# - 'cran_rstudio' | ||
# - 'github_api' | ||
# - 'github_desc' | ||
# - 'github_raw' | ||
# - 'github_releases' | ||
# - 'github_tags' | ||
# - 'mran_snapshot' | ||
# - 'package_filename' | ||
# | ||
) | ||
result <- f() | ||
|
||
expect_s3_class(result, "data.frame") | ||
expect_true(all(c("Package", "Depends", "Imports") %in% names(result))) | ||
|
||
}) |