From aa0de0b26b5b7f2ec9f5587a294a44e308da5f3c Mon Sep 17 00:00:00 2001 From: shikokuchuo <53399081+shikokuchuo@users.noreply.github.com> Date: Sun, 3 Mar 2024 17:19:23 +0000 Subject: [PATCH] add to tests --- DESCRIPTION | 2 +- NEWS.md | 2 ++ tests/tests.R | 3 ++- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 6364e33..974ccc4 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: secretbase Type: Package Title: Cryptographic Hash and Extendable-Output Functions -Version: 0.3.0.1 +Version: 0.3.0.9000 Description: SHA-256, SHA-3 cryptographic hash and SHAKE256 extendable-output functions (XOF). The SHA-3 Secure Hash Standard was published by the National Institute of Standards and Technology (NIST) in 2015 at diff --git a/NEWS.md b/NEWS.md index 408301b..6951f6b 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,5 @@ +# secretbase 0.3.0.9000 (development) + # secretbase 0.3.0.1 * CRAN release correcting for Clang-UBSAN checks. diff --git a/tests/tests.R b/tests/tests.R index f795c7d..8e6cfbb 100644 --- a/tests/tests.R +++ b/tests/tests.R @@ -45,8 +45,9 @@ if (.Platform[["OS.type"]] == "unix") test_error(sha3(file = "~/"), "file read e # SHA-256 tests: test_equal(sha256("secret base"), "1951c1ca3d50e95e6ede2b1c26fefd0f0e8eba1e51a837f8ccefb583a2b686fe") test_equal(sha256("secret base", convert = NA)[2L], 1592348733L) -test_that(sha256("secret base", convert = FALSE), is.raw) +test_equal(sha256(sha256("secret base", convert = FALSE)), "bd45eca9cbd4404cd467909fa8a2196ee9ffc7cb7f70f6343ff6647419744d41") test_equal(sha256(data.frame(a = 1, b = 2)), "189874c3ac59edecb4eab95a2d7c1bbb293a6ccd04e3da5b28daca91ebc7f15b") +test_error(sha256(file = NULL), "'file' must be specified as a character string") hash_func <- function(file, string) { on.exit(unlink(file)) cat(string, file = file)