tests/testthat/test-mean.R

context("test backend function")


test_that("test call add_new_row position", {
  res <- mean(c(1,2,3,4,5,6))

## Testing 'res'                                                            ####
## Initially generated by xpectr
xpectr::set_test_seed(42)
# Testing class
expect_equal(
  class(res),
  "numeric",
  fixed = TRUE)
# Testing type
expect_type(
  res,
  type = "double")
# Testing values
expect_equal(
  res,
  3.5,
  tolerance = 1e-4)
# Testing names
expect_equal(
  names(res),
  NULL,
  fixed = TRUE)
# Testing length
expect_equal(
  length(res),
  1L)                                                ####
})
DavidFingerKB/Shinytest documentation built on Sept. 1, 2020, 12:05 a.m.