diff options
Diffstat (limited to 'test/lisp/arc-mode-tests.el')
-rw-r--r-- | test/lisp/arc-mode-tests.el | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/test/lisp/arc-mode-tests.el b/test/lisp/arc-mode-tests.el index 63e5579b39b..341a835039e 100644 --- a/test/lisp/arc-mode-tests.el +++ b/test/lisp/arc-mode-tests.el @@ -1,6 +1,6 @@ ;;; arc-mode-tests.el --- Test suite for arc-mode. -*- lexical-binding: t -*- -;; Copyright (C) 2017 Free Software Foundation, Inc. +;; Copyright (C) 2017-2022 Free Software Foundation, Inc. ;; This file is part of GNU Emacs. @@ -21,17 +21,31 @@ (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------") (cons 420 "-rw-r--r--") (cons 292 "-r--r--r--") - (cons 512 "----------") + (cons 512 "---------T") (cons 1024 "------S---") ; Bug#28092 (cons 2048 "---S------")))) (dolist (x alist) - (should (equal (cdr x) (archive-int-to-mode (car x))))))) + (should (equal (cdr x) (file-modes-number-to-symbolic (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 +;;; arc-mode-tests.el ends here |