Rename obarray-foreach to obarray-map

* lisp/obarray.el (obarray-map): New name.
* test/automated/obarray-tests.el: Update the corresponding tests.
This commit is contained in:
Nicolas Petton 2015-11-11 17:53:41 +01:00
parent a3b210129c
commit 20aea42934
2 changed files with 4 additions and 4 deletions

View file

@ -57,7 +57,7 @@ Creates and adds the symbol if doesn't exist."
Return t on success, nil otherwise."
(unintern name obarray))
(defun obarray-foreach (fn obarray)
(defun obarray-map (fn obarray)
"Call function FN on every symbol in OBARRAY and return nil."
(mapatoms fn obarray))

View file

@ -73,17 +73,17 @@
(should (obarray-remove table "aoeu"))
(should-not (obarray-get table "aoeu"))))
(ert-deftest obarray-foreach-test ()
(ert-deftest obarray-map-test ()
"Should execute function on all elements of obarray."
(let* ((table (obarray-make 3))
(syms '())
(collect-names (lambda (sym) (push (symbol-name sym) syms))))
(obarray-foreach collect-names table)
(obarray-map collect-names table)
(should (null syms))
(obarray-put table "a")
(obarray-put table "b")
(obarray-put table "c")
(obarray-foreach collect-names table)
(obarray-map collect-names table)
(should (equal (sort syms #'string<) '("a" "b" "c")))))
(provide 'obarray-tests)