Skip to content

Commit 99205ab

Browse files
committed
Different condition to skip tests
1 parent 82d1a5d commit 99205ab

File tree

3 files changed

+10
-5
lines changed

3 files changed

+10
-5
lines changed

tests/testthat/helper.R

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
11
is_r_devel <- function() {
22
startsWith(R.version$status, "Under development")
33
}
4+
5+
is_win_r41 <- function() {
6+
x <- getRversion()
7+
is_windows() && x$major == 4 && x$minor == 1
8+
}

tests/testthat/test-Compiled.R

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
context("Compiled")
22
test_that("Compiled code coverage is reported including code in headers", {
33
skip_on_cran()
4-
skip_if(is_windows() && getRversion() == "4.1")
4+
skip_if(is_win_r41())
55

66
cov <- as.data.frame(package_coverage("TestCompiled", relative_path = TRUE))
77

@@ -34,7 +34,7 @@ test_that("Compiled code coverage is reported including code in headers", {
3434

3535
test_that("Can pass path to relative_path argument", {
3636
skip_on_cran()
37-
skip_if(is_windows() && getRversion() == "4.1")
37+
skip_if(is_win_r41())
3838
cov <- as.data.frame(package_coverage("TestCompiled", relative_path = "."))
3939

4040
expect_true(all(unique(cov$filename) %in% c(
@@ -47,7 +47,7 @@ test_that("Can pass path to relative_path argument", {
4747

4848
test_that("Source code subdirectories are found", {
4949
skip_on_cran()
50-
skip_if(is_windows() && getRversion() == "4.1")
50+
skip_if(is_win_r41())
5151
cov <- as.data.frame(package_coverage("TestCompiledSubdir", relative_path = TRUE))
5252

5353
expect_equal(cov[cov$first_line == "9", "value"], 4)
@@ -63,7 +63,7 @@ test_that("Source code subdirectories are found", {
6363

6464
test_that("Compiled code coverage is reported under non-standard char's", {
6565
skip_on_cran()
66-
skip_if(is_windows() && getRversion() == "4.1")
66+
skip_if(is_win_r41())
6767
cov <- as.data.frame(package_coverage("Test+Char/TestCompiled", relative_path = TRUE))
6868

6969
expect_equal(cov[cov$first_line == "9", "value"], 4)

tests/testthat/test-tally_coverage.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
test_that("tally_coverage includes compiled code", {
22
skip_on_cran()
3-
skip_if(is_windows() && getRversion() == "4.1")
3+
skip_if(is_win_r41())
44

55
cov <- package_coverage(test_path("TestCompiled"))
66
tall <- tally_coverage(cov)

0 commit comments

Comments
 (0)