tests/testthat/test-fabs.R

test_that("fabs", {
  expect_identical(fabs(numeric(0)), numeric(0))
  expect_identical(fabs(NA), NA_integer_)
  expect_identical(fabs(-1), 1)
  expect_identical(fabs(c(-1.3, 2.777)), c(1.3, 2.777))
  expect_identical(fabs(-1:2), c(1L, 0L, 1L, 2L))
})

Try the extras package in your browser

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

extras documentation built on Aug. 5, 2021, 9:07 a.m.