branch: scratch/editorconfig-cc commit b303bfd2208639f68134119bfd441dd383b77d36 Author: 10sr <8.slas...@gmail.com> Commit: Stefan Monnier <monn...@iro.umontreal.ca>
Add test for -hack-properties-functions --- ert-tests/editorconfig.el | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/ert-tests/editorconfig.el b/ert-tests/editorconfig.el index b9d795fd2d..cd3665360c 100644 --- a/ert-tests/editorconfig.el +++ b/ert-tests/editorconfig.el @@ -42,22 +42,22 @@ (editorconfig-mode 1) (with-visit-file (concat editorconfig-secondary-ert-dir - "2_space.el") + "2_space.el") (should (eq lisp-indent-offset 2))) (let ((editorconfig-lisp-use-default-indent t)) (with-visit-file (concat editorconfig-secondary-ert-dir - "2_space.el") + "2_space.el") (should (eq lisp-indent-offset nil)))) (let ((editorconfig-lisp-use-default-indent 2)) (with-visit-file (concat editorconfig-secondary-ert-dir - "2_space.el") + "2_space.el") (should (eq lisp-indent-offset nil)))) (let ((editorconfig-lisp-use-default-indent 4)) (with-visit-file (concat editorconfig-secondary-ert-dir - "2_space.el") + "2_space.el") (should (eq lisp-indent-offset 2)))) (editorconfig-mode -1)) @@ -92,3 +92,14 @@ (should (eq major-mode 'perl-mode)) (should (eq perl-indent-level 5))) (editorconfig-mode -1)) + +(ert-deftest test-hack-properties-functions nil + (editorconfig-mode 1) + (add-hook 'editorconfig-hack-properties-functions + (lambda (props) + (puthash 'indent_size "5" props))) + (with-visit-file (concat editorconfig-ert-dir + "4_space.py") + (should (eq python-indent-offset 5))) + (setq editorconfig-hack-properties-functions nil) + (editorconfig-mode -1))