diff options
| author | Basil L. Contovounesios | 2019-05-26 11:23:03 +0100 |
|---|---|---|
| committer | Basil L. Contovounesios | 2019-05-26 11:56:57 +0100 |
| commit | 9fe3bdf25d63f441e973cdcf88de0b26b53a54a3 (patch) | |
| tree | 27fda777d24745dd6b2d6ca4ff12a16c4be20967 | |
| parent | a51ab2f357af49f67feaa6e9484fcca2c91f5cb4 (diff) | |
| download | emacs-9fe3bdf25d63f441e973cdcf88de0b26b53a54a3.tar.gz emacs-9fe3bdf25d63f441e973cdcf88de0b26b53a54a3.zip | |
Tweak recent additions in tabify-tests.el
* test/lisp/tabify-tests.el (tabify-tests--test-changes): Rename
third argument to avoid "lexical argument shadows dynamic variable"
warnings. Use mapconcat in place of mapcar+concat.
(tabify-tests-untabify, tabify-tests-tabify): Quote function symbols
as such.
| -rw-r--r-- | test/lisp/tabify-tests.el | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/test/lisp/tabify-tests.el b/test/lisp/tabify-tests.el index 6670702eace..db073338b37 100644 --- a/test/lisp/tabify-tests.el +++ b/test/lisp/tabify-tests.el | |||
| @@ -24,12 +24,12 @@ | |||
| 24 | (require 'ert) | 24 | (require 'ert) |
| 25 | (require 'tabify) | 25 | (require 'tabify) |
| 26 | 26 | ||
| 27 | (defun tabify-tests--test-changes (fun changes tab-width) | 27 | (defun tabify-tests--test-changes (fun changes width) |
| 28 | (with-temp-buffer | 28 | (with-temp-buffer |
| 29 | (let ((tab-width tab-width)) | 29 | (let ((tab-width width)) |
| 30 | (insert (apply 'concat (mapcar 'car changes))) | 30 | (insert (mapconcat #'car changes "")) |
| 31 | (funcall fun (point-min) (point-max)) | 31 | (funcall fun (point-min) (point-max)) |
| 32 | (should (equal (buffer-string) (apply 'concat (mapcar 'cadr changes))))))) | 32 | (should (equal (buffer-string) (mapconcat #'cadr changes "")))))) |
| 33 | 33 | ||
| 34 | (ert-deftest tabify-tests-untabify () | 34 | (ert-deftest tabify-tests-untabify () |
| 35 | (let ((changes '(("***\n" "***\n") | 35 | (let ((changes '(("***\n" "***\n") |
| @@ -44,7 +44,7 @@ | |||
| 44 | (" \t ***\n" " ***\n") | 44 | (" \t ***\n" " ***\n") |
| 45 | (" \t***\n" " ***\n") | 45 | (" \t***\n" " ***\n") |
| 46 | (" \t***\n" " ***\n")))) | 46 | (" \t***\n" " ***\n")))) |
| 47 | (tabify-tests--test-changes 'untabify changes 2))) | 47 | (tabify-tests--test-changes #'untabify changes 2))) |
| 48 | 48 | ||
| 49 | (ert-deftest tabify-tests-tabify () | 49 | (ert-deftest tabify-tests-tabify () |
| 50 | (let ((changes '(("***\n" "***\n") | 50 | (let ((changes '(("***\n" "***\n") |
| @@ -58,7 +58,7 @@ | |||
| 58 | ("\t***\n" "\t***\n") | 58 | ("\t***\n" "\t***\n") |
| 59 | ("\t ***\n" "\t ***\n") | 59 | ("\t ***\n" "\t ***\n") |
| 60 | ("\t\t***\n" "\t\t***\n")))) | 60 | ("\t\t***\n" "\t\t***\n")))) |
| 61 | (tabify-tests--test-changes 'tabify changes 2))) | 61 | (tabify-tests--test-changes #'tabify changes 2))) |
| 62 | 62 | ||
| 63 | (ert-deftest tabify-tests-tabify/all-spaces-on-line () | 63 | (ert-deftest tabify-tests-tabify/all-spaces-on-line () |
| 64 | (with-temp-buffer | 64 | (with-temp-buffer |