File: test-base-comparison.R

package info (click to toggle)
r-cran-assertthat 0.2.1-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, forky, sid, trixie
  • size: 220 kB
  • sloc: sh: 9; makefile: 2
file content (10 lines) | stat: -rw-r--r-- 454 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
context("base-comparison")

test_that("assert_that respects custom error messages for base operators", {
  expect_error(assert_that(5 == 'i'), "not equal to")
  expect_error(assert_that(5 < 4), "not less than")
  expect_error(assert_that(4 > 5), "not greater than")
  expect_error(assert_that(4 >= 5), "not greater than or equal to")
  expect_error(assert_that(5 <= 4), "not less than or equal to")
  expect_error(assert_that(5 != 5), "not equal to")
})