tests/testthat/_snaps/variations.md

assignment

# Generated by doctest: do not edit by hand
# Please edit file in R/<text>

test_that("Doctest: unknown", {
  # Created from @doctest for `unknown`
  # Source file: <text>
  # Source line: 2
  expect_equal(x <- 1, 1)
})

assignment with dot

# Generated by doctest: do not edit by hand
# Please edit file in R/<text>

test_that("Doctest: unknown", {
  # Created from @doctest for `unknown`
  # Source file: <text>
  # Source line: 2
  expect_equal(x <- c("t", "e", "n", "e", "t"), rev(x))
})

comment

# Generated by doctest: do not edit by hand
# Please edit file in R/<text>

test_that("Doctest: unknown", {
  # Created from @doctest for `unknown`
  # Source file: <text>
  # Source line: 2
  expect_equal(2 + 2, 4)
})

Multiple @doctest tags

# Generated by doctest: do not edit by hand
# Please edit file in R/<text>

test_that("Doctest: unknown", {
  # Created from @doctest for `unknown`
  # Source file: <text>
  # Source line: 2
  expect_equal(x <- 1, 1)
})

test_that("Doctest: unknown", {
  # Created from @doctest for `unknown`
  # Source file: <text>
  # Source line: 6
  expect_equal(2 + 2, 4)
})


Try the doctest package in your browser

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

doctest documentation built on May 29, 2024, 7:09 a.m.