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"')
expect_equal(format(make_def("a", "b", "?=")), "a?=b")
})
test_that("error checking", {
expect_error(make_def(LETTERS, letters), "character value")
expect_error(make_def("a", letters), "character value")
expect_error(make_def("a", "b", letters), "character value")
})
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.