Skip to content

Commit

Permalink
more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Polkas committed Sep 23, 2024
1 parent 78d9cbc commit 9d9c9c8
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
2 changes: 1 addition & 1 deletion tests/testthat/test-compare.R
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ test_that("pacs::pac_compare_news", {

test_that("pacs::pac_compare_news online", {
skip_if_offline()
expect_true(length(pac_compare_news("dplyr", "0.7.1", "1.0.0")) == 947)
expect_true(length(pac_compare_news("dplyr", "0.7.1", "1.0.0")) > 0)
expect_true(length(pac_compare_news("memoise", old = "1.0.0")) > 0)
expect_true(length(pac_compare_news("memoise", "1.0.0", "2.0.0")) > 0)
})
2 changes: 1 addition & 1 deletion tests/testthat/test-description.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ test_that("pacs::pac_description", {
pac_description("memoise", local = TRUE)$Version,
pac_description("memoise", local = FALSE)$Version
) %in% c(0, -1))
expect_identical(pac_description("dplyr", "1.1.1.1"), NA)
expect_identical(pac_description("dplyr", "10.1.1.1"), NA)
expect_identical(pac_description("WRONG"), NA)
expect_identical(pac_description("WRONG", local = TRUE), NA)
expect_identical(pac_description("dplyr", "0.0.0.1"), NA)
Expand Down
11 changes: 9 additions & 2 deletions tests/testthat/test-news.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
test_that("pacs::pac_news", {
test_that("valid input pacs::pac_news", {
skip_if_offline()
expect_true(is.character(pac_news("dplyr", version = "0.8.0")))
expect_true(is.character(pac_news("dplyr", at = as.Date("2019-02-01"))))
})
})

test_that("invalid input pacs::pac_news", {
skip_if_offline()
expect_identical(pac_news("dplyr", version = "0.0.0.1"), NA)
expect_identical(pac_news("dplyr", version = "10.8.0.0"), NA)
expect_identical(pac_news("dplyr2", at = as.Date("2019-02-01")), NA)
})

0 comments on commit 9d9c9c8

Please sign in to comment.