tests/testthat/test_is_windows.R

library(testthat)



context("test_is_windows.R")



source("init_unit_test.R")



test_that("conflict in Windows OS recognition throws a warning", {

  # qualified func names are required otherwise R CMD CHECK will fail in testthat
  # (not finding the functions)
  with_mock(
      `tryCatchLog:::get.sys.name`         = function() return("windows"),
      `tryCatchLog:::get.platform.OS.type` = function() return("Clever OS"),
      expect_warning(tryCatchLog:::is.windows(),
                     "could not be recognized for sure", fixed = TRUE)
  )

})

Try the tryCatchLog package in your browser

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

tryCatchLog documentation built on Oct. 25, 2021, 9:08 a.m.