summaryrefslogtreecommitdiff
path: root/test/lisp/emacs-lisp
diff options
context:
space:
mode:
authorStefan Kangas <stefan@marxist.se>2020-10-24 02:56:00 +0200
committerStefan Kangas <stefan@marxist.se>2020-10-24 03:20:48 +0200
commit3af9e84ff59811734dcbb5d55e04e1fdb7051e77 (patch)
tree1b9bb536a35a2674cf777059f185a479e9b51713 /test/lisp/emacs-lisp
parent8461cfc8fcef424c7f1098f967679b4bdaa4348e (diff)
downloademacs-3af9e84ff59811734dcbb5d55e04e1fdb7051e77.tar.gz
emacs-3af9e84ff59811734dcbb5d55e04e1fdb7051e77.tar.bz2
emacs-3af9e84ff59811734dcbb5d55e04e1fdb7051e77.zip
Fix a broken unsafep test
* test/lisp/emacs-lisp/unsafep-tests.el (test-unsafep/message): Fix test case. (unsafep-tests--safe): Rename from testcover-unsafep-safe. (unsafep-tests--unsafe): Rename from testcover-unsafep-unsafe. (test-unsafep/safe, test-unsafep/unsafe): Doc fix. Adjust usage of above renamed variables.
Diffstat (limited to 'test/lisp/emacs-lisp')
-rw-r--r--test/lisp/emacs-lisp/unsafep-tests.el22
1 files changed, 10 insertions, 12 deletions
diff --git a/test/lisp/emacs-lisp/unsafep-tests.el b/test/lisp/emacs-lisp/unsafep-tests.el
index 2b920a00ca4..dde0e0201d9 100644
--- a/test/lisp/emacs-lisp/unsafep-tests.el
+++ b/test/lisp/emacs-lisp/unsafep-tests.el
@@ -27,7 +27,7 @@
(defvar safe-functions)
;;; These forms are all considered safe
-(defconst testcover-unsafep-safe
+(defconst unsafep-tests--safe
'(((lambda (x) (* x 2)) 14)
(apply 'cdr (mapcar (lambda (x) (car x)) y))
(cond ((= x 4) 5) (t 27))
@@ -47,7 +47,7 @@
"List of forms that `unsafep' should decide are safe.")
;;; These forms are considered unsafe
-(defconst testcover-unsafep-unsafe
+(defconst unsafep-tests--unsafe
'(( (add-to-list x y)
. (unquoted x))
( (add-to-list y x)
@@ -106,25 +106,23 @@
( (let (1) 2)
. (variable 1))
)
- "A-list of (FORM . REASON)... that`unsafep' should decide are unsafe.")
+ "A-list of (FORM . REASON)... that `unsafep' should decide are unsafe.")
(ert-deftest test-unsafep/safe ()
- "Executes all unsafep tests and displays the coverage results."
+ "Check safe forms with safe-functions nil."
(let (safe-functions)
- (dolist (x testcover-unsafep-safe)
+ (dolist (x unsafep-tests--safe)
(should-not (unsafep x)))))
(ert-deftest test-unsafep/message ()
- ;; FIXME: This failed after converting these tests from testcover to
- ;; ert.
- :expected-result :failed
- (should-not '(dolist (x y) (message "here: %s" x)))
- (should-not '(dotimes (x 14 (* x 2)) (message "here: %d" x))))
+ "Check that message is considered unsafe."
+ (should (unsafep '(dolist (x y) (message "here: %s" x))))
+ (should (unsafep '(dotimes (x 14 (* x 2)) (message "here: %d" x)))))
(ert-deftest test-unsafep/unsafe ()
- "Executes all unsafep tests and displays the coverage results."
+ "Check unsafe forms with safe-functions nil."
(let (safe-functions)
- (dolist (x testcover-unsafep-unsafe)
+ (dolist (x unsafep-tests--unsafe)
(should (equal (unsafep (car x)) (cdr x))))))
(ert-deftest test-unsafep/safe-functions-t ()