diff options
Diffstat (limited to 'test')
| -rw-r--r-- | test/lisp/ibuffer-tests.el | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/test/lisp/ibuffer-tests.el b/test/lisp/ibuffer-tests.el index 3a4def3a2b0..6d5187a2b77 100644 --- a/test/lisp/ibuffer-tests.el +++ b/test/lisp/ibuffer-tests.el | |||
| @@ -66,5 +66,34 @@ | |||
| 66 | (mapc (lambda (buf) (when (buffer-live-p buf) | 66 | (mapc (lambda (buf) (when (buffer-live-p buf) |
| 67 | (kill-buffer buf))) (list buf1 buf2))))) | 67 | (kill-buffer buf))) (list buf1 buf2))))) |
| 68 | 68 | ||
| 69 | (ert-deftest ibuffer-save-filters () | ||
| 70 | "Tests that `ibuffer-save-filters' saves in the proper format." | ||
| 71 | (skip-unless (featurep 'ibuf-ext)) | ||
| 72 | (let ((ibuffer-save-with-custom nil) | ||
| 73 | (ibuffer-saved-filters nil) | ||
| 74 | (test1 '((mode . org-mode) | ||
| 75 | (or (size-gt . 10000) | ||
| 76 | (and (not (starred-name)) | ||
| 77 | (directory . "\<org\>"))))) | ||
| 78 | (test2 '((or (mode . emacs-lisp-mode) (file-extension . "elc?") | ||
| 79 | (and (starred-name) (name . "elisp")) | ||
| 80 | (mode . lisp-interaction-mode)))) | ||
| 81 | (test3 '((size-lt . 100) (derived-mode . prog-mode) | ||
| 82 | (or (filename . "scratch") | ||
| 83 | (filename . "bonz") | ||
| 84 | (filename . "temp"))))) | ||
| 85 | (ibuffer-save-filters "test1" test1) | ||
| 86 | (should (equal (car ibuffer-saved-filters) (cons "test1" test1))) | ||
| 87 | (ibuffer-save-filters "test2" test2) | ||
| 88 | (should (equal (car ibuffer-saved-filters) (cons "test2" test2))) | ||
| 89 | (should (equal (cadr ibuffer-saved-filters) (cons "test1" test1))) | ||
| 90 | (ibuffer-save-filters "test3" test3) | ||
| 91 | (should (equal (car ibuffer-saved-filters) (cons "test3" test3))) | ||
| 92 | (should (equal (cadr ibuffer-saved-filters) (cons "test2" test2))) | ||
| 93 | (should (equal (car (cddr ibuffer-saved-filters)) (cons "test1" test1))) | ||
| 94 | (should (equal (cdr (assoc "test1" ibuffer-saved-filters)) test1)) | ||
| 95 | (should (equal (cdr (assoc "test2" ibuffer-saved-filters)) test2)) | ||
| 96 | (should (equal (cdr (assoc "test3" ibuffer-saved-filters)) test3)))) | ||
| 97 | |||
| 69 | (provide 'ibuffer-tests) | 98 | (provide 'ibuffer-tests) |
| 70 | ;; ibuffer-tests.el ends here | 99 | ;; ibuffer-tests.el ends here |