diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/lisp/files-resources/.dir-locals.el | 2 | ||||
-rw-r--r-- | test/lisp/files-resources/whatever.quux | 2 | ||||
-rw-r--r-- | test/lisp/files-tests.el | 5 |
3 files changed, 9 insertions, 0 deletions
diff --git a/test/lisp/files-resources/.dir-locals.el b/test/lisp/files-resources/.dir-locals.el new file mode 100644 index 00000000000..84997b8a0c0 --- /dev/null +++ b/test/lisp/files-resources/.dir-locals.el @@ -0,0 +1,2 @@ +;; This is used by files-tests.el. +((auto-mode-alist . (("\\.quux\\'" . tcl-mode)))) diff --git a/test/lisp/files-resources/whatever.quux b/test/lisp/files-resources/whatever.quux new file mode 100644 index 00000000000..595583b911e --- /dev/null +++ b/test/lisp/files-resources/whatever.quux @@ -0,0 +1,2 @@ +# Used by files-test.el. +# Due to .dir-locals.el this should end up in Tcl mode. diff --git a/test/lisp/files-tests.el b/test/lisp/files-tests.el index a6b0c900bec..fce7e3fd719 100644 --- a/test/lisp/files-tests.el +++ b/test/lisp/files-tests.el @@ -1534,5 +1534,10 @@ The door of all subtleties! (should-error (file-name-with-extension "Jack" ".")) (should-error (file-name-with-extension "/is/a/directory/" "css"))) +(ert-deftest files-test-dir-locals-auto-mode-alist () + "Test an `auto-mode-alist' entry in `.dir-locals.el'" + (find-file (ert-resource-file "whatever.quux")) + (should (eq major-mode 'tcl-mode))) + (provide 'files-tests) ;;; files-tests.el ends here |