tests/testthat/test-def.R

context("def")

test_that("definitions", {
  expect_equal(format(make_def("a", "b")), "a=b")
  expect_equal(format(make_def("a", "b c")), "a=b c")
  expect_equal(format(make_def("a", "'b c'")), "a='b c'")
  expect_equal(format(make_def("a", '"b c"')), 'a="b c"')
})

test_that("error checking", {
  expect_error(make_def(LETTERS, letters), "character value")
  expect_error(make_def("a", letters), "character value")
})

Try the MakefileR package in your browser

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

MakefileR documentation built on May 1, 2019, 10:30 p.m.