tests/testthat/test-utils.R

# Tests for url_file_exists
with_mock_api({
  test_that("url_file_exists", {
    # url does not exist
    expect_false(url_file_exists())
  })
})

# Tests for clean_repo_links
test_that("clean_repo_links ", {
  results <- clean_repo_links("notarepo, github.com/arepo", "github.com/arepo/issues") #nolint
  expect_equal(results, "github.com/arepo")
})

# Tests for clean_repo_links
test_that("catch ", {
  # package does not exist
  expect_equal(catch("a string"), "a string")
  expect_null(catch(NULL), NULL)
})

Try the hexFinder package in your browser

Any scripts or data that you put into this service are public.

hexFinder documentation built on Feb. 16, 2023, 8:11 p.m.