tests/testthat/test_line_assign.R

context("line_assign")

test_that("line_assign returns obect of type closure", {
  expect_type(line_assign(strwidth, 2, "a"), "closure")
})

test_that("line_assign gives error for primitive functions", {
  expect_error(line_assign(sum, 2, "a"))
})

test_that("line_assign throws error for arg line = 1", {
  expect_error(line_assign(strwrap, 1, "a"))
})

Try the frite package in your browser

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

frite documentation built on July 1, 2018, 5:04 p.m.