tests/testthat/test-getEnter.R

current_os <- Sys.info()[["sysname"]]

test_that("getEnter() works", {
  expect_equal(getEnter("Win"), ifelse(current_os == "Windows", "\n", "\r\n"))
  expect_equal(getEnter("Mac"), ifelse(current_os == "Darwin", "\n", "\r"))
  expect_equal(getEnter("Linux"), "\n")
  expect_error(getEnter("Unknown"))
})

Try the DDIwR package in your browser

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

DDIwR documentation built on Oct. 1, 2023, 5:06 p.m.