]> git.eshelyaron.com Git - emacs.git/commitdiff
Prefer skip-unless in more tests
authorStefan Kangas <stefan@marxist.se>
Wed, 13 Jan 2021 16:39:53 +0000 (17:39 +0100)
committerStefan Kangas <stefan@marxist.se>
Wed, 13 Jan 2021 16:39:53 +0000 (17:39 +0100)
* 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
test/src/decompress-tests.el
test/src/xml-tests.el

index 74da33eff69a87a7bbcedbd988b5e9b22d78e91c..7856c217f9ef016e9f0c89496a5198ae9fe989ca 100644 (file)
@@ -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
index 67a7fefb05ebe17e0da0c7343732e26f259d5f74..520445cca5a2fc1ac660f9d0c5705d0182340ff9 100644 (file)
 
 (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)
 
index 632cf965fa2655539ea67aa64fbd8fbf38191b40..a35b4d2ccc87f5e16ffda2b20ac607b0d77dae58 100644 (file)
 
 (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