File: test-base.R

package info (click to toggle)
r-cran-assertthat 0.1-1~bpo8%2B1
  • links: PTS, VCS
  • area: main
  • in suites: jessie-backports
  • size: 188 kB
  • sloc: sh: 9; makefile: 1
file content (15 lines) | stat: -rw-r--r-- 404 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
context("Base assertions")

test_that("any message is useful", {
  expect_equal(validate_that(any(TRUE, FALSE)), TRUE)
  
  x <- c(FALSE, FALSE)
  expect_equal(validate_that(any(x)), "No elements of x are true")
})

test_that("all message is useful", {
  expect_equal(validate_that(all(TRUE, TRUE)), TRUE)
  
  x <- c(FALSE, TRUE)
  expect_match(validate_that(all(x)), "Elements .* of x are not true")
})