]> git.eshelyaron.com Git - emacs.git/commitdiff
; Fix last change to filelock-tests.el
authorEli Zaretskii <eliz@gnu.org>
Sun, 19 Dec 2021 15:44:32 +0000 (17:44 +0200)
committerEli Zaretskii <eliz@gnu.org>
Sun, 19 Dec 2021 15:44:32 +0000 (17:44 +0200)
* test/src/filelock-tests.el (filelock-tests-file-locked-p-spoiled)
(filelock-tests-unlock-spoiled)
(filelock-tests-kill-buffer-spoiled): Expect 'permission-denied' only
on MS-Windows.

test/src/filelock-tests.el

index 2d682e2e7895f5a9f8ea678bc52039e3a97dec09..24dd37e5a4d11d998b5ab21b06a6a89542e86619 100644 (file)
@@ -123,7 +123,9 @@ the case)."
      (filelock-tests--spoil-lock-file buffer-file-truename)
      (let ((err (should-error (file-locked-p (buffer-file-name)))))
        (should (equal (seq-subseq err 0 2)
-                      '(permission-denied "Testing file lock")))))))
+                      (if (eq system-type 'windows-nt)
+                          '(permission-denied "Testing file lock")
+                        '(file-error "Testing file lock"))))))))
 
 (ert-deftest filelock-tests-unlock-spoiled ()
   "Check that `unlock-buffer' fails if the lockfile is \"spoiled\"."
@@ -144,8 +146,11 @@ the case)."
                   (lambda (err) (push err errors))))
          (unlock-buffer))
        (should (consp errors))
-       (should (equal '(permission-denied "Unlocking file")
-                      (seq-subseq (car errors) 0 2)))
+       (should (equal
+                (if (eq system-type 'windows-nt)
+                    '(permission-denied "Unlocking file")
+                  '(file-error "Unlocking file"))
+                (seq-subseq (car errors) 0 2)))
        (should (equal (length errors) 1))))))
 
 (ert-deftest filelock-tests-kill-buffer-spoiled ()
@@ -174,8 +179,11 @@ the case)."
                   (lambda (err) (push err errors))))
          (kill-buffer))
        (should (consp errors))
-       (should (equal '(permission-denied "Unlocking file")
-                      (seq-subseq (car errors) 0 2)))
+       (should (equal
+                (if (eq system-type 'windows-nt)
+                    '(permission-denied "Unlocking file")
+                  '(file-error "Unlocking file"))
+                (seq-subseq (car errors) 0 2)))
        (should (equal (length errors) 1))))))
 
 (provide 'filelock-tests)