Skip to content
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

add a few tests #56

Merged
merged 9 commits into from
Sep 16, 2021
2 changes: 0 additions & 2 deletions tests/test-all.R

This file was deleted.

2 changes: 2 additions & 0 deletions tests/test-ci.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# tests to run on CI servers (e.g. Github Actions)
if (tolower(Sys.getenv('CI')) == 'true') testit::test_pkg('xfun', 'test-ci')
1 change: 1 addition & 0 deletions tests/test-ci/test-revcheck.R
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
library(testit)
1 change: 1 addition & 0 deletions tests/test-cran.R
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
testit::test_pkg('xfun', 'test-cran')
File renamed without changes.
File renamed without changes.
9 changes: 9 additions & 0 deletions tests/test-cran/test-cran.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
library(testit)

assert("pkg_maintainers() works", {
x = pkg_maintainers("xfun")
(length(x) > 0)
# %==% not working for some reason
(x %==% c(xfun = packageDescription('xfun', fields = 'Maintainer')))
})

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,8 @@ assert("loadable() works", {
# (!loadable("#base", new_session = TRUE))
(!loadable("#base", strict = FALSE))
})

assert("major_mninor_smaller() works", {
(major_minor_smaller(as.numeric_version("4.1.0"), as.numeric_version("4.2.0")))
(!major_minor_smaller(as.numeric_version("4.1.0"), as.numeric_version("4.1.1")))
})
File renamed without changes.
File renamed without changes.
File renamed without changes.