File: test_hash_error.R

package info (click to toggle)
r-cran-openssl 1.4.3%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 1,288 kB
  • sloc: ansic: 3,021; sh: 97; 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))

})