[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/base32 7f0fe12bce 063/103: Fix tests after the Great Renam
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/base32 7f0fe12bce 063/103: Fix tests after the Great Renaming |
Date: |
Sat, 10 Feb 2024 13:00:08 -0500 (EST) |
branch: elpa/base32
commit 7f0fe12bcef48a4afabfc970a2398356053d920e
Author: Vivek Das Mohapatra <vivek@collabora.co.uk>
Commit: Vivek Das Mohapatra <vivek@collabora.co.uk>
Fix tests after the Great Renaming
---
tests/test-totp.el | 35 ++++++++++++++++++-----------------
1 file changed, 18 insertions(+), 17 deletions(-)
diff --git a/tests/test-totp.el b/tests/test-totp.el
index a54fea6d4a..fe6d2fa8ac 100644
--- a/tests/test-totp.el
+++ b/tests/test-totp.el
@@ -106,21 +106,22 @@
(defun totp-check-results (label target digits algorithm &rest generated-otp)
(let ((i 0)
(want (string-to-number (substring target (- digits))))
- (stamp (format-time-string "%Y-%m-%d %H:%M:%S" totp-override-time t))
+ (stamp (format-time-string "%Y-%m-%d %H:%M:%S"
+ totp-auth-override-time t))
have)
(dolist (otp generated-otp)
(setq have (string-to-number (car otp)))
(or (equal want have)
(error "%s TOTP #%d @%d (%s), %S %d digits did not match: %S vs %S"
- label i totp-override-time stamp algorithm digits want have))
+ label i totp-auth-override-time stamp algorithm digits want
have))
(setq i (1+ i)))
- (message "%8s TOTP @%d (%s) OK" label totp-override-time stamp)
+ (message "%8s TOTP @%d (%s) OK" label totp-auth-override-time stamp)
i))
(defun test-totp-secret (algo)
"The TOTP RFC test secret is the digits repeated up to N bytes,
where N depends on the HMAC algorithm."
- (hmac-xor (make-string (cond ((eq algo 'sha1) 20)
+ (totp-auth-hmac-xor (make-string (cond ((eq algo 'sha1) 20)
((eq algo 'sha256) 32)
((eq algo 'sha512) 64))
0)
@@ -129,31 +130,31 @@ where N depends on the HMAC algorithm."
;; sha1 is the default algo so don't pass it:
;; likewise 6 is the
(defun test-totp-check-parameters (params)
- (let ((totp-override-time (nth 0 params))
- (algorithm (nth 1 params))
- (result-8 (nth 2 params))
+ (let ((totp-auth-override-time (nth 0 params))
+ (algorithm (nth 1 params))
+ (result-8 (nth 2 params))
key)
(setq key (base32-encode (test-totp-secret algorithm)))
(dolist (digits '(8 7 6))
(cond
((and (eq digits 6) (eq algorithm 'sha1))
(totp-check-results "sha1:6" result-8 digits algorithm
- (totp-generate-otp key)
- (totp-generate-otp key digits)
- (totp-generate-otp key nil nil nil algorithm)
- (totp-generate-otp key digits nil nil algorithm)))
+ (totp-auth-generate-otp key)
+ (totp-auth-generate-otp key digits)
+ (totp-auth-generate-otp key nil nil nil
algorithm)
+ (totp-auth-generate-otp key digits nil nil
algorithm)))
((eq digits 6)
(totp-check-results (format "%s:6" algorithm) result-8 digits algorithm
- (totp-generate-otp key nil nil nil algorithm)
- (totp-generate-otp key digits nil nil algorithm)))
+ (totp-auth-generate-otp key nil nil nil
algorithm)
+ (totp-auth-generate-otp key digits nil nil
algorithm)))
((eq algorithm 'sha1)
(totp-check-results (format "sha1:%d" digits) result-8 digits algorithm
- (totp-generate-otp key digits nil nil)
- (totp-generate-otp key digits nil nil algorithm)))
+ (totp-auth-generate-otp key digits nil nil)
+ (totp-auth-generate-otp key digits nil nil
algorithm)))
(t
(totp-check-results (format "%s:%d" algorithm digits)
result-8 digits algorithm
- (totp-generate-otp key digits nil nil
algorithm)))))
+ (totp-auth-generate-otp key digits nil nil
algorithm)))))
t))
(defconst test-totp-import-expected-results
@@ -213,7 +214,7 @@ earlier ones, whic would therefore not be returned by
`assoc`)."
(mapc
(lambda (test-file &optional expected actual)
(setq expected (cdr (assoc test-file test-totp-import-expected-results))
- actual (totp-load-file
+ actual (totp-auth-load-file
(expand-file-name test-file test-totp-source-dir)))
(if (test-totp-compare-alist-list expected actual test-file)
(message "%s imported OK" test-file)
- [nongnu] elpa/base32 56b160f436 005/103: Handle .netrc style backends containing otpauth url secrets, (continued)
- [nongnu] elpa/base32 56b160f436 005/103: Handle .netrc style backends containing otpauth url secrets, ELPA Syncer, 2024/02/10
- [nongnu] elpa/base32 5065525032 024/103: Update docstrings and readme, ELPA Syncer, 2024/02/10
- [nongnu] elpa/base32 1c9bc087ba 039/103: totp-auto-copy-password: improve docstring and fix defcustom typos, ELPA Syncer, 2024/02/10
- [nongnu] elpa/base32 a066bd453f 029/103: Remove totp-minimum-ui-grace which we're not using after all, ELPA Syncer, 2024/02/10
- [nongnu] elpa/base32 15218226f9 053/103: checkdoc is having Opinions™ again, ELPA Syncer, 2024/02/10
- [nongnu] elpa/base32 0c9ab0005b 054/103: Rename all the things as we migrate from totp-… to totp-auth-…, ELPA Syncer, 2024/02/10
- [nongnu] elpa/base32 4492236c1f 055/103: Squash some warnings when byte-compiling the tests, ELPA Syncer, 2024/02/10
- [nongnu] elpa/base32 a15c27157a 050/103: Checkdoc incorrectly detects .\n as "not a complete sentence", ELPA Syncer, 2024/02/10
- [nongnu] elpa/base32 bd7959a5ef 058/103: Add a LICENSE (sic) to match the SPDX entries, ELPA Syncer, 2024/02/10
- [nongnu] elpa/base32 d435f806a0 059/103: Documentation changes related to the Great Renaming, ELPA Syncer, 2024/02/10
- [nongnu] elpa/base32 7f0fe12bce 063/103: Fix tests after the Great Renaming,
ELPA Syncer <=
- [nongnu] elpa/base32 4708406887 067/103: Add comm to package's keywords, ELPA Syncer, 2024/02/10
- [nongnu] elpa/base32 6843417e38 068/103: Rename interactive entry point from totp to totp-auth, ELPA Syncer, 2024/02/10
- [nongnu] elpa/base32 c31034feef 069/103: Fix the totp-auth-hmac.el footer comment, ELPA Syncer, 2024/02/10
- [nongnu] elpa/base32 5e5f311775 077/103: Fix a checkdoc warning in base32-lsh, ELPA Syncer, 2024/02/10
- [nongnu] elpa/base32 60dbfaf621 079/103: Use the warning-suppressing lsh wrapper from base32.el, ELPA Syncer, 2024/02/10
- [nongnu] elpa/base32 49cb6d5468 078/103: Implement the base32hex encoding from RFC4648, ELPA Syncer, 2024/02/10
- [nongnu] elpa/base32 a41fe7d0f7 072/103: Trivia: fix markup in test file docstring, ELPA Syncer, 2024/02/10
- [nongnu] elpa/base32 ed4feed432 080/103: Fix a checkdoc warning., ELPA Syncer, 2024/02/10
- [nongnu] elpa/base32 c04d223e11 074/103: Fix a docstring xref, ELPA Syncer, 2024/02/10
- [nongnu] elpa/base32 269044a4a2 082/103: Replace a single use of cl-case with cond, ELPA Syncer, 2024/02/10