File: test-basic.R

package info (click to toggle)
r-cran-testthat 3.3.2-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 4,048 kB
  • sloc: cpp: 9,269; sh: 14; ansic: 14; makefile: 5
file content (22 lines) | stat: -rw-r--r-- 439 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
test_that("logical tests act as expected", {
  expect_true(TRUE)
  expect_false(FALSE)
})

test_that("logical tests ignore attributes", {
  expect_true(c(a = TRUE))
  expect_false(c(a = FALSE))
})

test_that("equality holds", {
  expect_equal(5, 5)
  expect_identical(10, 10)
})

test_that("can't access variables from other tests 2", {
  a <- 10
})

test_that("can't access variables from other tests 1", {
  expect_false(exists("a"))
})