aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars Ingebrigtsen2019-06-13 01:51:44 +0200
committerLars Ingebrigtsen2019-06-13 01:53:58 +0200
commit73ab8f4b8cb6f08e7b694bdadcd42751b3916dae (patch)
tree7314a1236eac2d720761964ec89368b11ce954ca
parente2e63dc3f062ec3dee56f003efb3e093b56692d4 (diff)
downloademacs-73ab8f4b8cb6f08e7b694bdadcd42751b3916dae.tar.gz
emacs-73ab8f4b8cb6f08e7b694bdadcd42751b3916dae.zip
New file rfc2104-tests.el
* test/lisp/net/rfc2104-tests.el: New file to test rfc2104 hashes.
-rw-r--r--test/lisp/net/rfc2104-tests.el39
1 files changed, 39 insertions, 0 deletions
diff --git a/test/lisp/net/rfc2104-tests.el b/test/lisp/net/rfc2104-tests.el
new file mode 100644
index 00000000000..db6fccab190
--- /dev/null
+++ b/test/lisp/net/rfc2104-tests.el
@@ -0,0 +1,39 @@
1;;; rfc2104-tests.el --- Tests of RFC2104 hashes
2
3;; Copyright (C) 2019 Free Software Foundation, Inc.
4
5;; Author: Lars Ingebrigtsen <larsi@gnus.org>
6
7;; This program is free software: you can redistribute it and/or
8;; modify it under the terms of the GNU General Public License as
9;; published by the Free Software Foundation, either version 3 of the
10;; License, or (at your option) any later version.
11;;
12;; This program is distributed in the hope that it will be useful, but
13;; WITHOUT ANY WARRANTY; without even the implied warranty of
14;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15;; General Public License for more details.
16;;
17;; You should have received a copy of the GNU General Public License
18;; along with this program. If not, see `https://www.gnu.org/licenses/'.
19
20;;; Code:
21
22(require 'ert)
23(require 'rfc2104)
24(require 'sha1)
25(require 'md5)
26
27(ert-deftest dbus-test-sha1 ()
28 (should
29 (equal (rfc2104-hash 'sha1 64 20 "Jefe" "what do ya want for nothing?")
30 "effcdf6ae5eb2fa2d27416d5f184df9c259a7c79")))
31
32(ert-deftest dbus-test-md5 ()
33 (should
34 (equal (rfc2104-hash 'md5 64 16 "Jefe" "what do ya want for nothing?")
35 "750c783e6ab0b503eaa86e310a5db738")))
36
37(provide 'rfc2104-tests)
38
39;;; rfc2104-tests.el ends here