emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master be9b7e8: Prefer skip-unless in more tests


From: Stefan Kangas
Subject: master be9b7e8: Prefer skip-unless in more tests
Date: Wed, 13 Jan 2021 11:40:44 -0500 (EST)

branch: master
commit be9b7e83bc4191aff01c692be0f7a156ec4056da
Author: Stefan Kangas <stefan@marxist.se>
Commit: Stefan Kangas <stefan@marxist.se>

    Prefer skip-unless in more tests
    
    * test/lisp/emacs-lisp/timer-tests.el (timer-tests-debug-timer-check):
    * test/src/decompress-tests.el (zlib--decompress):
    * test/src/xml-tests.el (libxml-tests): Prefer skip-unless.
---
 test/lisp/emacs-lisp/timer-tests.el |  4 ++--
 test/src/decompress-tests.el        | 20 ++++++++++----------
 test/src/xml-tests.el               | 14 +++++++-------
 3 files changed, 19 insertions(+), 19 deletions(-)

diff --git a/test/lisp/emacs-lisp/timer-tests.el 
b/test/lisp/emacs-lisp/timer-tests.el
index 74da33e..7856c21 100644
--- a/test/lisp/emacs-lisp/timer-tests.el
+++ b/test/lisp/emacs-lisp/timer-tests.el
@@ -36,8 +36,8 @@
 
 (ert-deftest timer-tests-debug-timer-check ()
   ;; This function exists only if --enable-checking.
-  (if (fboundp 'debug-timer-check)
-      (should (debug-timer-check)) t))
+  (skip-unless (fboundp 'debug-timer-check))
+  (should (debug-timer-check)))
 
 (ert-deftest timer-test-multiple-of-time ()
   (should (time-equal-p
diff --git a/test/src/decompress-tests.el b/test/src/decompress-tests.el
index 67a7fef..520445c 100644
--- a/test/src/decompress-tests.el
+++ b/test/src/decompress-tests.el
@@ -29,16 +29,16 @@
 
 (ert-deftest zlib--decompress ()
   "Test decompressing a gzipped file."
-  (when (and (fboundp 'zlib-available-p)
-            (zlib-available-p))
-    (should (string=
-            (with-temp-buffer
-              (set-buffer-multibyte nil)
-              (insert-file-contents-literally
-               (expand-file-name "foo.gz" zlib-tests-data-directory))
-              (zlib-decompress-region (point-min) (point-max))
-              (buffer-string))
-            "foo\n"))))
+  (skip-unless (and (fboundp 'zlib-available-p)
+                    (zlib-available-p)))
+  (should (string=
+           (with-temp-buffer
+             (set-buffer-multibyte nil)
+             (insert-file-contents-literally
+              (expand-file-name "foo.gz" zlib-tests-data-directory))
+             (zlib-decompress-region (point-min) (point-max))
+             (buffer-string))
+           "foo\n")))
 
 (provide 'decompress-tests)
 
diff --git a/test/src/xml-tests.el b/test/src/xml-tests.el
index 632cf96..a35b4d2 100644
--- a/test/src/xml-tests.el
+++ b/test/src/xml-tests.el
@@ -44,12 +44,12 @@
 
 (ert-deftest libxml-tests ()
   "Test libxml."
-  (when (fboundp 'libxml-parse-xml-region)
-    (with-temp-buffer
-      (dolist (test libxml-tests--data-comments-preserved)
-        (erase-buffer)
-        (insert (car test))
-        (should (equal (cdr test)
-                       (libxml-parse-xml-region (point-min) (point-max))))))))
+  (skip-unless (fboundp 'libxml-parse-xml-region))
+  (with-temp-buffer
+    (dolist (test libxml-tests--data-comments-preserved)
+      (erase-buffer)
+      (insert (car test))
+      (should (equal (cdr test)
+                     (libxml-parse-xml-region (point-min) (point-max)))))))
 
 ;;; libxml-tests.el ends here



reply via email to

[Prev in Thread] Current Thread [Next in Thread]