emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master d087263: * test/src/fns-tests.el (test-secure-hash): Test getrand


From: Paul Eggert
Subject: master d087263: * test/src/fns-tests.el (test-secure-hash): Test getrandom format.
Date: Mon, 29 Jun 2020 12:55:38 -0400 (EDT)

branch: master
commit d0872638b4f6330bdece465d6cbf5c1d85306c35
Author: Paul Eggert <eggert@cs.ucla.edu>
Commit: Paul Eggert <eggert@cs.ucla.edu>

    * test/src/fns-tests.el (test-secure-hash): Test getrandom format.
---
 test/src/fns-tests.el | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/test/src/fns-tests.el b/test/src/fns-tests.el
index b65543a..f1faf58 100644
--- a/test/src/fns-tests.el
+++ b/test/src/fns-tests.el
@@ -890,6 +890,8 @@
   (should (equal (secure-hash 'sha512 "foobar")
                  (concat "0a50261ebd1a390fed2bf326f2673c145582a6342d5"
                          "23204973d0219337f81616a8069b012587cf5635f69"
-                         "25f1b56c360230c19b273500ee013e030601bf2425"))))
-
-(provide 'fns-tests)
+                         "25f1b56c360230c19b273500ee013e030601bf2425")))
+  ;; Test that a call to getrandom returns the right format.
+  ;; This does not test randomness; it's merely a format check.
+  (should (string-match "\\`[0-9a-f]\\{128\\}\\'"
+                        (secure-hash 'sha512 'iv-auto 100))))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]