Skip to content

Commit bbc1ec8

Browse files
committed
Add some tests
1 parent 5bfdb30 commit bbc1ec8

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

tests/testthat/test-expect-self-test.R

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,19 @@ test_that("show_failure", {
2727
expect_null(show_failure(NULL))
2828
expect_output(show_failure(expect_true(FALSE)), "FALSE is not TRUE")
2929
})
30+
31+
test_that("can test for presence and absense of failure", {
32+
expect_success(expect_failure(fail()))
33+
expect_success(expect_no_failure(succeed()))
34+
35+
expect_failure(expect_failure(succeed()))
36+
expect_failure(expect_no_failure(fail()))
37+
})
38+
39+
test_that("can test for presence and absense of success", {
40+
expect_success(expect_success(succeed()))
41+
expect_success(expect_no_success(fail()))
42+
43+
expect_failure(expect_success(fail()))
44+
expect_failure(expect_no_success(succeed()))
45+
})

0 commit comments

Comments
 (0)