(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\"."
(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 ()
(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)