tests/testthat/test-detect_os.R

test_that("OS detectors return a single logical", {
  expect_length(is_windows(), 1L)
  expect_length(is_osx(), 1L)
  expect_length(is_unix(), 1L)
  expect_type(is_windows(), "logical")
  expect_type(is_osx(), "logical")
  expect_type(is_unix(), "logical")
})

test_that("exactly one OS detector is TRUE", {
  expect_equal(sum(is_windows(), is_osx(), is_unix()), 1L)
})

Try the locatexec package in your browser

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

locatexec documentation built on Oct. 21, 2026, 5:12 p.m.