From 3bc62bfa9ad48428cd280e4c162a06916688f6c1 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Mattias=20Engdeg=C3=A5rd?= Date: Mon, 14 Aug 2023 16:34:29 +0200 Subject: [PATCH] Actually check the result of `equal` comparisons in tests * 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 | 4 ++-- test/lisp/files-tests.el | 16 ++++++++-------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/test/lisp/calc/calc-tests.el b/test/lisp/calc/calc-tests.el index 41c47e5332c..5b11dd950ba 100644 --- a/test/lisp/calc/calc-tests.el +++ b/test/lisp/calc/calc-tests.el @@ -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 diff --git a/test/lisp/files-tests.el b/test/lisp/files-tests.el index f6c7be88b05..7fb862e7892 100644 --- a/test/lisp/files-tests.el +++ b/test/lisp/files-tests.el @@ -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) -- 2.39.2