Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
2023-05-14 Mats Lidell <matsl@gnu.org>

* hypb.el (hypb:oct-to-int): mapc takes two args.

* test/hypb-tests.el: Add tests for hypb:oct-to-int.

2023-05-14 Bob Weiner <rsw@gnu.org>

* hibtypes.el (action): Remove unneeded comma before args that triggered
Expand Down
4 changes: 2 additions & 2 deletions hypb.el
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
;; Author: Bob Weiner
;;
;; Orig-Date: 6-Oct-91 at 03:42:38
;; Last-Mod: 14-May-23 at 10:51:09 by Bob Weiner
;; Last-Mod: 14-May-23 at 22:54:11 by Mats Lidell
;;
;; SPDX-License-Identifier: GPL-3.0-or-later
;;
Expand Down Expand Up @@ -1049,7 +1049,7 @@ Without file, the banner is prepended to the current buffer."
(setq dec-num (+ (* dec-num 8)
(when (and (>= o ?0) (<= o ?7))
(- o ?0)))))
oct-str "")
oct-str)
dec-num))

;;; ************************************************************************
Expand Down
11 changes: 10 additions & 1 deletion test/hypb-tests.el
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
;; Author: Mats Lidell <matsl@gnu.org>
;;
;; Orig-Date: 5-Apr-21 at 18:53:10
;; Last-Mod: 13-May-23 at 10:10:25 by Bob Weiner
;; Last-Mod: 14-May-23 at 23:12:39 by Mats Lidell
;;
;; SPDX-License-Identifier: GPL-3.0-or-later
;;
Expand Down Expand Up @@ -65,6 +65,15 @@
(mock (file-exists-p "/home/user/hyperbole/.git") => nil)
(should (equal (car (hypb:installation-type)) "unknown")))))

(ert-deftest hypb--oct-to-int ()
"Verify oct to int conversion."
(should (= (hypb:oct-to-int 0) 0))
(should (= (hypb:oct-to-int 1) 1))
(should (= (hypb:oct-to-int 7) 7))
(should (= (hypb:oct-to-int 10) 8))
(should (= (hypb:oct-to-int 2000) 1024))
(should-error (hypb:oct-to-int 8) :type 'error))

;; This file can't be byte-compiled without the `el-mock' package (because of
;; the use of the `with-mock' macro), which is not a dependency of Hyperbole.
;; Local Variables:
Expand Down