File: test_hash_error.R

package info (click to toggle)
r-cran-openssl 2.0.5%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 1,312 kB
  • sloc: ansic: 3,074; sh: 20; makefile: 5
file content (13 lines) | stat: -rw-r--r-- 375 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
context("Test the error handlers for hash functions")

test_that("non-vector inputs are detected", {

  expect_that(md5(list(c("foo","bar"),"baz")), throws_error(regexp = "must be raw or character vector", fixed = TRUE))

})

test_that("non-character inputs are detected", {

  expect_that(md5(12), throws_error(regexp = "must be raw or character vector", fixed = TRUE))

})