]> git.eshelyaron.com Git - emacs.git/commitdiff
Actually check the result of `equal` comparisons in tests
authorMattias Engdegård <mattiase@acm.org>
Mon, 14 Aug 2023 14:34:29 +0000 (16:34 +0200)
committerMattias Engdegård <mattiase@acm.org>
Mon, 14 Aug 2023 15:03:44 +0000 (17:03 +0200)
* test/lisp/calc/calc-tests.el (calc-bit-ops):
* test/lisp/files-tests.el
(files-tests-file-name-non-special-substitute-in-file-name)
(files-tests-file-name-non-special-temporary-file-directory)
(files-tests-file-name-non-special-unhandled-file-name-directory):
Add missing `should` assertions.

test/lisp/calc/calc-tests.el
test/lisp/files-tests.el

index 41c47e5332c25f0fff1d326916e3cf0c22998609..5b11dd950ba48a5aa4cd24b1e2eed4fdf5f78590 100644 (file)
@@ -698,8 +698,8 @@ An existing calc stack is reused, otherwise a new one is created."
                      (calc-tests--not x w)))
 
       (dolist (n '(0 1 4 16 32 -1 -4 -16 -32))
-        (equal (calcFunc-clip x n)
-               (calc-tests--clip x n)))
+        (should (equal (calcFunc-clip x n)
+                       (calc-tests--clip x n))))
 
       (dolist (y '(0 1 #x1234 #x8000 #xabcd #xffff
                      #x12345678 #xabcdef12 #x80000000 #xffffffff
index f6c7be88b05e01330473a7d24a432e1e0fecf704..7fb862e78920776655d98c0de2da6519b0d967e8 100644 (file)
@@ -1204,30 +1204,30 @@ unquoted file names."
     (let ((process-environment (cons "FOO=foo" process-environment))
           (nospecial-foo (files-tests--new-name nospecial "$FOO")))
       ;; The "/:" prevents substitution.
-      (equal (substitute-in-file-name nospecial-foo) nospecial-foo)))
+      (should (equal (substitute-in-file-name nospecial-foo) nospecial-foo))))
   (files-tests--with-temp-non-special-and-file-name-handler (tmpfile nospecial)
     (let ((process-environment (cons "FOO=foo" process-environment))
           (nospecial-foo (files-tests--new-name nospecial "$FOO")))
       ;; The "/:" prevents substitution.
-      (equal (substitute-in-file-name nospecial-foo) nospecial-foo))))
+      (should (equal (substitute-in-file-name nospecial-foo) nospecial-foo)))))
 
 (ert-deftest files-tests-file-name-non-special-temporary-file-directory ()
   (files-tests--with-temp-non-special (tmpdir nospecial-dir t)
     (let ((default-directory nospecial-dir))
-      (equal (temporary-file-directory) temporary-file-directory)))
+      (should (equal (temporary-file-directory) temporary-file-directory))))
   (files-tests--with-temp-non-special-and-file-name-handler
       (tmpdir nospecial-dir t)
     (let ((default-directory nospecial-dir))
-      (equal (temporary-file-directory) temporary-file-directory))))
+      (should (equal (temporary-file-directory) temporary-file-directory)))))
 
 (ert-deftest files-tests-file-name-non-special-unhandled-file-name-directory ()
   (files-tests--with-temp-non-special (tmpdir nospecial-dir t)
-    (equal (unhandled-file-name-directory nospecial-dir)
-           (file-name-as-directory tmpdir)))
+    (should (equal (unhandled-file-name-directory nospecial-dir)
+                   (file-name-as-directory tmpdir))))
   (files-tests--with-temp-non-special-and-file-name-handler
       (tmpdir nospecial-dir t)
-    (equal (unhandled-file-name-directory nospecial-dir)
-           (file-name-as-directory tmpdir))))
+    (should (equal (unhandled-file-name-directory nospecial-dir)
+                   (file-name-as-directory tmpdir)))))
 
 (ert-deftest files-tests-file-name-non-special-vc-registered ()
   (files-tests--with-temp-non-special (tmpfile nospecial)