1 ;;; dired-x-tests.el --- Test suite for dired-x. -*- lexical-binding: t -*-
3 ;; Copyright (C) 2017-2018 Free Software Foundation, Inc.
5 ;; This file is part of GNU Emacs.
7 ;; GNU Emacs is free software: you can redistribute it and/or modify
8 ;; it under the terms of the GNU General Public License as published by
9 ;; the Free Software Foundation, either version 3 of the License, or
10 ;; (at your option) any later version.
12 ;; GNU Emacs is distributed in the hope that it will be useful,
13 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
14 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 ;; GNU General Public License for more details.
17 ;; You should have received a copy of the GNU General Public License
18 ;; along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
25 (ert-deftest dired-test-bug25942
()
26 "Test for https://debbugs.gnu.org/25942 ."
27 (let* ((dirs (list "Public" "Music"))
28 (files (list ".bashrc" "bar.c" "foo.c" "c" ".c"))
31 (append (copy-sequence dirs
)
32 (delete "c" (copy-sequence files
)))
34 (dir (make-temp-file "Bug25942" 'dir
))
39 (make-directory (expand-file-name d dir
)))
41 (write-region nil nil
(expand-file-name f dir
)))
43 (dired-mark-extension extension
)
44 (should (equal '("bar.c" "foo.c")
45 (sort (dired-get-marked-files 'local
) #'string
<)))
46 (dired-unmark-all-marks)
47 (dired-mark-suffix extension
)
48 (should (equal all-but-c
49 (sort (dired-get-marked-files 'local
) #'string
<))))
50 (delete-directory dir
'recursive
))))
52 (provide 'dired-x-tests
)
53 ;; dired-x-tests.el ends here