diff options
| author | Philipp Stephani | 2017-06-16 23:49:09 +0200 |
|---|---|---|
| committer | Philipp Stephani | 2017-06-17 16:10:51 +0200 |
| commit | c3813b2aa8d2f5a625195fdbbfe6a01a602d7735 (patch) | |
| tree | 1bf3a0498632f317ed27e6e7d99171d611964f4d /test | |
| parent | 5575db9216e949fa1535dac33eec9b2abb48fab4 (diff) | |
| download | emacs-c3813b2aa8d2f5a625195fdbbfe6a01a602d7735.tar.gz emacs-c3813b2aa8d2f5a625195fdbbfe6a01a602d7735.zip | |
Allow local variables section to begin with a square bracket
Fixes Bug#27391.
* lisp/international/mule.el (find-auto-coding): Fix regular
expression for "Local Variables" section.
* test/lisp/international/mule-tests.el (find-auto-coding--bug27391):
Add unit test.
Diffstat (limited to 'test')
| -rw-r--r-- | test/lisp/international/mule-tests.el | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/test/lisp/international/mule-tests.el b/test/lisp/international/mule-tests.el new file mode 100644 index 00000000000..d7453332437 --- /dev/null +++ b/test/lisp/international/mule-tests.el | |||
| @@ -0,0 +1,39 @@ | |||
| 1 | ;;; mule-tests.el --- unit tests for mule.el -*- lexical-binding: t; -*- | ||
| 2 | |||
| 3 | ;; Copyright (C) 2017 Free Software Foundation, Inc. | ||
| 4 | |||
| 5 | ;; This file is part of GNU Emacs. | ||
| 6 | |||
| 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. | ||
| 11 | |||
| 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. | ||
| 16 | |||
| 17 | ;; You should have received a copy of the GNU General Public License | ||
| 18 | ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. | ||
| 19 | |||
| 20 | ;;; Commentary: | ||
| 21 | |||
| 22 | ;; Unit tests for lisp/international/mule.el. | ||
| 23 | |||
| 24 | ;;; Code: | ||
| 25 | |||
| 26 | (ert-deftest find-auto-coding--bug27391 () | ||
| 27 | "Check that Bug#27391 is fixed." | ||
| 28 | (with-temp-buffer | ||
| 29 | (insert "\n[comment]: # ( Local Variables: )\n" | ||
| 30 | "[comment]: # ( coding: utf-8 )\n" | ||
| 31 | "[comment]: # ( End: )\n") | ||
| 32 | (goto-char (point-min)) | ||
| 33 | (should (equal (let ((auto-coding-alist ()) | ||
| 34 | (auto-coding-regexp-alist ()) | ||
| 35 | (auto-coding-functions ())) | ||
| 36 | (find-auto-coding "" (buffer-size))) | ||
| 37 | '(utf-8 . :coding))))) | ||
| 38 | |||
| 39 | ;;; mule-tests.el ends here | ||