diff --git a/tests/testthat/test-compare.R b/tests/testthat/test-compare.R index 067ab28..d8aa1f0 100644 --- a/tests/testthat/test-compare.R +++ b/tests/testthat/test-compare.R @@ -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) }) diff --git a/tests/testthat/test-description.R b/tests/testthat/test-description.R index 26d0956..0f89059 100644 --- a/tests/testthat/test-description.R +++ b/tests/testthat/test-description.R @@ -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) diff --git a/tests/testthat/test-news.R b/tests/testthat/test-news.R index ed8b0eb..e08b624 100644 --- a/tests/testthat/test-news.R +++ b/tests/testthat/test-news.R @@ -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")))) -}) \ No newline at end of file +}) + +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) +})