1local_edition(2)
2
3context("Successes")
4
5test_that("Success", {
6  succeed()
7})
8
9context("Failures")
10
11test_that("Failure:1", {
12  expect_true(FALSE)
13})
14
15test_that("Failure:2a", {
16  f <- function() expect_true(FALSE)
17  f()
18})
19
20context("Errors")
21
22test_that("Error:1", {
23  stop("stop")
24})
25
26test_that("errors get tracebacks", {
27  f <- function() g()
28  g <- function() h()
29  h <- function() stop("!")
30
31  f()
32})
33
34context("Skips")
35
36test_that("explicit skips are reported", {
37  skip("skip")
38})
39
40test_that("empty tests are implicitly skipped", {
41})
42
43context("Warnings")
44
45test_that("warnings get backtraces", {
46  f <- function() {
47    warning("def")
48  }
49  f()
50})
51