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.
This commit is contained in:
Stefan Kangas 2021-01-13 17:39:53 +01:00
parent 19b169c4e2
commit be9b7e83bc
3 changed files with 19 additions and 19 deletions

View 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

View file

@ -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)

View file

@ -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