-
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.
Create tests with kwb.test::create_test_files()
and modify some tests. Skip tests that would detach testthat! Skip test that would install the remotes package!
- Loading branch information
Showing
84 changed files
with
1,295 additions
and
2 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
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 @@ | ||
# This file is part of the standard setup for testthat. | ||
# It is recommended that you do not modify it. | ||
# | ||
# Where should you do additional test configuration? | ||
# Learn more about the roles of various files in: | ||
# * https://r-pkgs.org/tests.html | ||
# * https://testthat.r-lib.org/reference/test_package.html#special-files | ||
|
||
library(testthat) | ||
library(kwb.package) | ||
|
||
test_check("kwb.package") |
Binary file not shown.
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 @@ | ||
# | ||
# This file was generated by kwb.test::create_test_files(), | ||
# launched by hsonne on 2024-05-02 18:06:13. | ||
# Please modify the dummy functions so that real cases are | ||
# tested. Then, delete this comment. | ||
# | ||
|
||
test_that("addNodeLabels() works", { | ||
|
||
f <- kwb.package::addNodeLabels | ||
|
||
expect_error( | ||
f() | ||
# Argument "nodes" fehlt (ohne Standardwert) | ||
) | ||
|
||
}) |
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 @@ | ||
# | ||
# This file was generated by kwb.test::create_test_files(), | ||
# launched by hsonne on 2024-05-02 17:58:25. | ||
# Please modify the dummy functions so that real cases are | ||
# tested. Then, delete this comment. | ||
# | ||
|
||
test_that("allDeps() works", { | ||
|
||
f <- kwb.package:::allDeps | ||
|
||
expect_error( | ||
f() | ||
# Argument "name" fehlt (ohne Standardwert) | ||
) | ||
|
||
}) |
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 @@ | ||
# | ||
# This file was generated by kwb.test::create_test_files(), | ||
# launched by hsonne on 2024-05-02 18:06:13. | ||
# Please modify the dummy functions so that real cases are | ||
# tested. Then, delete this comment. | ||
# | ||
|
||
test_that("anglesToPoints() works", { | ||
|
||
f <- kwb.package::anglesToPoints | ||
|
||
expect_error( | ||
f() | ||
# Argument "angles.grad" fehlt (ohne Standardwert) | ||
) | ||
|
||
}) |
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 @@ | ||
# | ||
# This file was generated by kwb.test::create_test_files(), | ||
# launched by hsonne on 2024-05-02 17:58:25. | ||
# Please modify the dummy functions so that real cases are | ||
# tested. Then, delete this comment. | ||
# | ||
|
||
test_that("archivedCranVersions() works", { | ||
|
||
f <- kwb.package::archivedCranVersions | ||
|
||
expect_error( | ||
f() | ||
# Argument "package" fehlt (ohne Standardwert) | ||
) | ||
|
||
}) |
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 @@ | ||
# | ||
# This file was generated by kwb.test::create_test_files(), | ||
# launched by hsonne on 2024-05-02 18:06:14. | ||
# Please modify the dummy functions so that real cases are | ||
# tested. Then, delete this comment. | ||
# | ||
|
||
test_that("cleanStop() works", { | ||
|
||
f <- kwb.package:::cleanStop | ||
|
||
expect_error( | ||
f() | ||
# | ||
) | ||
|
||
}) |
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 @@ | ||
# | ||
# This file was generated by kwb.test::create_test_files(), | ||
# launched by hsonne on 2024-05-02 17:58:25. | ||
# Please modify the dummy functions so that real cases are | ||
# tested. Then, delete this comment. | ||
# | ||
|
||
test_that("compareInstalledVersions() works", { | ||
|
||
f <- kwb.package::compareInstalledVersions | ||
|
||
expect_error( | ||
f() | ||
# Argument "lib1" fehlt (ohne Standardwert) | ||
) | ||
|
||
}) |
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 @@ | ||
# | ||
# This file was generated by kwb.test::create_test_files(), | ||
# launched by hsonne on 2024-05-02 17:58:25. | ||
# Please modify the dummy functions so that real cases are | ||
# tested. Then, delete this comment. | ||
# | ||
|
||
test_that("copyBasePackages() works", { | ||
|
||
f <- kwb.package::copyBasePackages | ||
|
||
expect_error( | ||
f() | ||
# Argument "target_lib" fehlt (ohne Standardwert) | ||
) | ||
|
||
}) |
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 @@ | ||
# | ||
# 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. | ||
# | ||
|
||
test_that("cranVersions() works", { | ||
|
||
f <- kwb.package::cranVersions | ||
|
||
expect_error( | ||
f() | ||
# Argument "name" fehlt (ohne Standardwert) | ||
) | ||
|
||
}) |
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 @@ | ||
#library(testthat) | ||
|
||
test_that("currentCranVersion() works", { | ||
|
||
f <- kwb.package:::currentCranVersion | ||
|
||
result <- f() | ||
|
||
expect_s3_class(result, "data.frame") | ||
expect_identical(names(result), c("package", "version", "date", "date_type")) | ||
|
||
}) |
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 @@ | ||
#library(testthat) | ||
|
||
test_that("defaultLocalCRAN() works", { | ||
|
||
f <- kwb.package:::defaultLocalCRAN | ||
|
||
result <- f() | ||
expect_true(endsWith(result, "/local-cran")) | ||
|
||
}) |
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 @@ | ||
#library(testthat) | ||
|
||
test_that("defaultPackageDir() works", { | ||
|
||
f <- kwb.package:::defaultPackageDir | ||
|
||
result <- f() | ||
|
||
expect_type(result, "character") | ||
expect_length(result, 1L) | ||
|
||
}) |
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,11 @@ | ||
#library(testthat) | ||
|
||
testthat::skip("Do not detach testthat!") | ||
|
||
test_that("detachAllNonSystemPackages() works", { | ||
|
||
f <- kwb.package::detachAllNonSystemPackages | ||
|
||
expect_output(f()) | ||
|
||
}) |
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,11 @@ | ||
#library(testthat) | ||
|
||
testthat::skip("Do not detach testthat!") | ||
|
||
test_that("detachRecursively() works", { | ||
|
||
f <- kwb.package::detachRecursively | ||
|
||
expect_error(f()) | ||
|
||
}) |
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 @@ | ||
#library(testthat) | ||
|
||
test_that("dirPackageZips() works", { | ||
|
||
f <- kwb.package:::dirPackageZips | ||
|
||
expect_error(f()) | ||
|
||
}) |
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 @@ | ||
# | ||
# This file was generated by kwb.test::create_test_files(), | ||
# launched by hsonne on 2024-05-02 17:58:28. | ||
# Please modify the dummy functions so that real cases are | ||
# tested. Then, delete this comment. | ||
# | ||
|
||
test_that("downloadGitHubPackage() works", { | ||
|
||
f <- kwb.package::downloadGitHubPackage | ||
|
||
expect_error( | ||
f() | ||
# Argument "repo" fehlt (ohne Standardwert) | ||
) | ||
|
||
}) |
17 changes: 17 additions & 0 deletions
17
tests/testthat/test-function-downloadPackagesFromSnapshot.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# | ||
# This file was generated by kwb.test::create_test_files(), | ||
# launched by hsonne on 2024-05-02 17:58:28. | ||
# Please modify the dummy functions so that real cases are | ||
# tested. Then, delete this comment. | ||
# | ||
|
||
test_that("downloadPackagesFromSnapshot() works", { | ||
|
||
f <- kwb.package::downloadPackagesFromSnapshot | ||
|
||
expect_error( | ||
f() | ||
# Argument "packages" fehlt (ohne Standardwert) | ||
) | ||
|
||
}) |
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 @@ | ||
# | ||
# This file was generated by kwb.test::create_test_files(), | ||
# launched by hsonne on 2024-05-02 18:06:13. | ||
# Please modify the dummy functions so that real cases are | ||
# tested. Then, delete this comment. | ||
# | ||
|
||
test_that("drawDependencies() works", { | ||
|
||
f <- kwb.package::drawDependencies | ||
|
||
expect_error( | ||
f() | ||
# Argument "nodes" fehlt (ohne Standardwert) | ||
) | ||
|
||
}) |
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 @@ | ||
# | ||
# This file was generated by kwb.test::create_test_files(), | ||
# launched by hsonne on 2024-05-02 18:06:13. | ||
# Please modify the dummy functions so that real cases are | ||
# tested. Then, delete this comment. | ||
# | ||
|
||
test_that("drawLink() works", { | ||
|
||
f <- kwb.package::drawLink | ||
|
||
expect_error( | ||
f() | ||
# Argument "nodes" fehlt (ohne Standardwert) | ||
) | ||
|
||
}) |
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 @@ | ||
# | ||
# This file was generated by kwb.test::create_test_files(), | ||
# launched by hsonne on 2024-05-02 18:06:13. | ||
# Please modify the dummy functions so that real cases are | ||
# tested. Then, delete this comment. | ||
# | ||
|
||
test_that("draw_circles() works", { | ||
|
||
f <- kwb.package:::draw_circles | ||
|
||
expect_error( | ||
f() | ||
# Argument "r" fehlt (ohne Standardwert) | ||
) | ||
|
||
}) |
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 @@ | ||
# | ||
# This file was generated by kwb.test::create_test_files(), | ||
# launched by hsonne on 2024-05-02 18:06:13. | ||
# Please modify the dummy functions so that real cases are | ||
# tested. Then, delete this comment. | ||
# | ||
|
||
test_that("equidistantAngles() works", { | ||
|
||
f <- kwb.package::equidistantAngles | ||
|
||
expect_error( | ||
f() | ||
# Argument "n" fehlt (ohne Standardwert) | ||
) | ||
|
||
}) |
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 @@ | ||
# | ||
# This file was generated by kwb.test::create_test_files(), | ||
# launched by hsonne on 2024-05-02 18:06:14. | ||
# Please modify the dummy functions so that real cases are | ||
# tested. Then, delete this comment. | ||
# | ||
|
||
test_that("exampleLinksAndNodes() works", { | ||
|
||
f <- kwb.package::exampleLinksAndNodes | ||
|
||
expect_error( | ||
f() | ||
# line 8 did not have 4 elements | ||
) | ||
|
||
}) |
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 @@ | ||
# | ||
# This file was generated by kwb.test::create_test_files(), | ||
# launched by hsonne on 2024-05-02 17:58:28. | ||
# Please modify the dummy functions so that real cases are | ||
# tested. Then, delete this comment. | ||
# | ||
|
||
test_that("findPackageFilename() works", { | ||
|
||
f <- kwb.package:::findPackageFilename | ||
|
||
expect_error( | ||
f() | ||
# Argument "tarfile" fehlt (ohne Standardwert) | ||
) | ||
|
||
}) |
Oops, something went wrong.