summaryrefslogtreecommitdiff
path: root/test/lisp
diff options
context:
space:
mode:
Diffstat (limited to 'test/lisp')
-rw-r--r--test/lisp/arc-mode-tests.el14
-rw-r--r--test/lisp/tar-mode-tests.el13
-rw-r--r--test/lisp/vc/diff-mode-tests.el4
3 files changed, 31 insertions, 0 deletions
diff --git a/test/lisp/arc-mode-tests.el b/test/lisp/arc-mode-tests.el
index e6857671393..79d3ac6365c 100644
--- a/test/lisp/arc-mode-tests.el
+++ b/test/lisp/arc-mode-tests.el
@@ -21,6 +21,8 @@
(require 'ert)
(require 'arc-mode)
+(defvar arc-mode-tests-data-directory
+ (expand-file-name "test/data/decompress" source-directory))
(ert-deftest arc-mode-test-archive-int-to-mode ()
(let ((alist (list (cons 448 "-rwx------")
@@ -32,6 +34,18 @@
(dolist (x alist)
(should (equal (cdr x) (archive-int-to-mode (car x)))))))
+(ert-deftest arc-mode-test-zip-extract-gz ()
+ (skip-unless (and archive-zip-extract (executable-find (car archive-zip-extract))))
+ (skip-unless (executable-find "gzip"))
+ (let* ((zip-file (expand-file-name "zg.zip" arc-mode-tests-data-directory))
+ zip-buffer gz-buffer)
+ (unwind-protect
+ (with-current-buffer (setq zip-buffer (find-file-noselect zip-file))
+ (setq gz-buffer (archive-extract))
+ (should (equal (char-after) ?\N{SNOWFLAKE})))
+ (when (buffer-live-p zip-buffer) (kill-buffer zip-buffer))
+ (when (buffer-live-p gz-buffer) (kill-buffer gz-buffer)))))
+
(provide 'arc-mode-tests)
;; arc-mode-tests.el ends here
diff --git a/test/lisp/tar-mode-tests.el b/test/lisp/tar-mode-tests.el
index 3ad0ced01d6..1fce200721b 100644
--- a/test/lisp/tar-mode-tests.el
+++ b/test/lisp/tar-mode-tests.el
@@ -21,6 +21,8 @@
(require 'ert)
(require 'tar-mode)
+(defvar tar-mode-tests-data-directory
+ (expand-file-name "test/data/decompress" source-directory))
(ert-deftest tar-mode-test-tar-grind-file-mode ()
(let ((alist (list (cons 448 "rwx------")
@@ -31,6 +33,17 @@
(dolist (x alist)
(should (equal (cdr x) (tar-grind-file-mode (car x)))))))
+(ert-deftest tar-mode-test-tar-extract-gz ()
+ (skip-unless (executable-find "gzip"))
+ (let* ((tar-file (expand-file-name "tg.tar.gz" tar-mode-tests-data-directory))
+ tar-buffer gz-buffer)
+ (unwind-protect
+ (with-current-buffer (setq tar-buffer (find-file-noselect tar-file))
+ (setq gz-buffer (tar-extract))
+ (should (equal (char-after) ?\N{SNOWFLAKE})))
+ (when (buffer-live-p tar-buffer) (kill-buffer tar-buffer))
+ (when (buffer-live-p gz-buffer) (kill-buffer gz-buffer)))))
+
(provide 'tar-mode-tests)
;; tar-mode-tests.el ends here
diff --git a/test/lisp/vc/diff-mode-tests.el b/test/lisp/vc/diff-mode-tests.el
index 8e690548f05..8695d958bac 100644
--- a/test/lisp/vc/diff-mode-tests.el
+++ b/test/lisp/vc/diff-mode-tests.el
@@ -204,6 +204,8 @@ youthfulness
(ert-deftest diff-mode-test-font-lock ()
"Check font-locking of diff hunks."
+ (skip-unless (executable-find shell-file-name))
+ (skip-unless (executable-find diff-command))
(let ((default-directory diff-mode-tests--datadir)
(old "hello_world.c")
(new "hello_emacs.c")
@@ -263,6 +265,8 @@ youthfulness
(ert-deftest diff-mode-test-font-lock-syntax-one-line ()
"Check diff syntax highlighting for one line with no newline at end."
+ (skip-unless (executable-find shell-file-name))
+ (skip-unless (executable-find diff-command))
(let ((default-directory diff-mode-tests--datadir)
(old "hello_world_1.c")
(new "hello_emacs_1.c")