Skip to content

Commit

Permalink
Add test for -hack-properties-functions
Browse files Browse the repository at this point in the history
  • Loading branch information
10sr committed Oct 23, 2018
1 parent 2f886a6 commit d93a6b1
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions ert-tests/editorconfig.el
Original file line number Diff line number Diff line change
Expand Up @@ -57,22 +57,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))

Expand Down Expand Up @@ -107,3 +107,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))

0 comments on commit d93a6b1

Please sign in to comment.