Skip to content

Commit

Permalink
add to tests
Browse files Browse the repository at this point in the history
  • Loading branch information
shikokuchuo committed Mar 3, 2024
1 parent e9f918d commit aa0de0b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 2 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# secretbase 0.3.0.9000 (development)

# secretbase 0.3.0.1

* CRAN release correcting for Clang-UBSAN checks.
Expand Down
3 changes: 2 additions & 1 deletion tests/tests.R
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit aa0de0b

Please sign in to comment.