tests/testthat/_snaps/assert_numerical.md

assert_whole_number() works [plain]

Code
  assert_whole_number(1.5)
Condition
  Error:
  ! '1.5' is not a whole number
Code
  assert_whole_number(0.5)
Condition
  Error:
  ! '0.5' is not a whole number
Code
  assert_whole_number(-1.5)
Condition
  Error:
  ! '-1.5' is not a whole number
Code
  assert_whole_number("abc")
Condition
  Error:
  ! '"abc"' is not a number! (class is character, not numeric)
Code
  assert_whole_number(c(1, 2, 3))
Condition
  Error:
  ! 'c(1, 2, 3)' is not a number! (length is 3, not 1)


Try the assertions package in your browser

Any scripts or data that you put into this service are public.

assertions documentation built on April 3, 2025, 5:52 p.m.